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/'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue