CI : add preprod stage (factorized with prod)
This commit is contained in:
parent
64589d8267
commit
691dd6d6e2
1 changed files with 19 additions and 7 deletions
|
|
@ -23,11 +23,9 @@ build:
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
|
||||||
deploy:
|
.deploy_template: &deploy_template
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: node:latest
|
image: node:latest
|
||||||
only:
|
|
||||||
- main
|
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get update -qq && apt-get install -y rsync sshpass
|
- apt-get update -qq && apt-get install -y rsync sshpass
|
||||||
script:
|
script:
|
||||||
|
|
@ -38,19 +36,33 @@ deploy:
|
||||||
--exclude 'cache/' \
|
--exclude 'cache/' \
|
||||||
--exclude 'sessions/' \
|
--exclude 'sessions/' \
|
||||||
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
||||||
site/ $USERNAME@$HOST:$PROD_PATH/site/
|
site/ $USERNAME@$HOST:$TARGET_PATH/site/
|
||||||
|
|
||||||
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
||||||
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
||||||
vendor/ $USERNAME@$HOST:$PROD_PATH/vendor/
|
vendor/ $USERNAME@$HOST:$TARGET_PATH/vendor/
|
||||||
|
|
||||||
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
||||||
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
||||||
kirby/ $USERNAME@$HOST:$PROD_PATH/kirby/
|
kirby/ $USERNAME@$HOST:$TARGET_PATH/kirby/
|
||||||
|
|
||||||
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
sshpass -p "$PASSWORD" rsync -avz --delete -O \
|
||||||
--exclude 'tiles/' \
|
--exclude 'tiles/' \
|
||||||
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
||||||
assets/ $USERNAME@$HOST:$PROD_PATH/assets/
|
assets/ $USERNAME@$HOST:$TARGET_PATH/assets/
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
|
deploy_prod:
|
||||||
|
<<: *deploy_template
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
variables:
|
||||||
|
TARGET_PATH: $PROD_PATH
|
||||||
|
|
||||||
|
deploy_preprod:
|
||||||
|
<<: *deploy_template
|
||||||
|
only:
|
||||||
|
- preprod
|
||||||
|
variables:
|
||||||
|
TARGET_PATH: $PREPROD_PATH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue