CI : create specific build for preprod
This commit is contained in:
parent
d9066defce
commit
c6d973e126
4 changed files with 60 additions and 29 deletions
|
|
@ -11,7 +11,7 @@ build:
|
|||
script:
|
||||
- apk add --no-cache nodejs npm
|
||||
- npm install
|
||||
- npm run build
|
||||
- if [ "$CI_COMMIT_REF_NAME" = "dev" ]; then npm run build:preprod; else npm run build; fi
|
||||
- cd dist
|
||||
- composer install --no-dev --optimize-autoloader --ignore-platform-req=ext-gd
|
||||
- cd ..
|
||||
|
|
@ -48,3 +48,29 @@ deploy:
|
|||
rsync_deploy vendor/ "$PROD_PATH/vendor/"
|
||||
rsync_deploy kirby/ "$PROD_PATH/kirby/"
|
||||
rsync_deploy assets/ "$PROD_PATH/assets/" "--exclude 'tiles/'"
|
||||
|
||||
deploy_dev:
|
||||
stage: deploy
|
||||
image: node:latest
|
||||
only:
|
||||
- dev
|
||||
before_script:
|
||||
- apt-get update -qq && apt-get install -y rsync sshpass
|
||||
script:
|
||||
- cd dist
|
||||
- |
|
||||
rsync_deploy() {
|
||||
local src=$1
|
||||
local dst=$2
|
||||
local exclude=$3
|
||||
cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O"
|
||||
[[ -n $exclude ]] && cmd="$cmd $exclude"
|
||||
cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst"
|
||||
echo "$cmd"
|
||||
eval $cmd
|
||||
}
|
||||
|
||||
rsync_deploy site/ "$PREPROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'"
|
||||
rsync_deploy vendor/ "$PREPROD_PATH/vendor/"
|
||||
rsync_deploy kirby/ "$PREPROD_PATH/kirby/"
|
||||
rsync_deploy assets/ "$PREPROD_PATH/assets/" "--exclude 'tiles/'"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"build:preprod": "vite build --mode=staging",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
$regenerateSteps = require_once(__DIR__ . '/hooks/page-update--regenerate-project-steps-cache.php');
|
||||
|
||||
return [
|
||||
'debug' => Dir::exists('assets/dist') ? false: true,
|
||||
'debug' => $_SERVER['HTTP_HOST'] !== 'designtopack.groupe-pochet.fr',
|
||||
'cache' => [
|
||||
'pages' => [
|
||||
'active' => true
|
||||
|
|
|
|||
|
|
@ -1,33 +1,37 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
base: '/',
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: 'assets/dist/[name].js',
|
||||
assetFileNames: 'assets/dist/[name].[ext]',
|
||||
export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
plugins: [vue()],
|
||||
base: '/',
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: 'assets/dist/[name].js',
|
||||
assetFileNames: 'assets/dist/[name].[ext]',
|
||||
},
|
||||
},
|
||||
sourcemap: mode === 'staging',
|
||||
minify: mode === 'production' ? 'esbuild' : false,
|
||||
},
|
||||
server: {
|
||||
watch: {
|
||||
ignored: [
|
||||
'**/node_modules/**',
|
||||
'**/.git/**',
|
||||
'**/.cache/**',
|
||||
'**/.vite/**',
|
||||
'**/dist/**',
|
||||
'**/*.log',
|
||||
'**/.idea/**',
|
||||
'**/.vscode/**',
|
||||
'**/public/assets/**',
|
||||
'**/local/**',
|
||||
'/public/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
watch: {
|
||||
ignored: [
|
||||
'**/node_modules/**',
|
||||
'**/.git/**',
|
||||
'**/.cache/**',
|
||||
'**/.vite/**',
|
||||
'**/dist/**',
|
||||
'**/*.log',
|
||||
'**/.idea/**',
|
||||
'**/.vscode/**',
|
||||
'**/public/assets/**',
|
||||
'**/local/**',
|
||||
'/public/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue