cicd: updated gitlab CI to deploy in multiple env

This commit is contained in:
plup 2020-03-15 17:11:16 +01:00
parent 86223fd9fc
commit 8588c91965
2 changed files with 73 additions and 42 deletions

View File

@ -1,89 +1,121 @@
image: node
image: node:11
stages:
- validate_features
- prepare_release
- validate_release
- deploy_production
- integration
- acceptance
- deployment
## TESTING ##
## VALIDATION ##
deploy_features:
stage: validate_features
deploy_test1:
stage: integration
environment:
name: integration
url: https://integration.startinblox.com
name: test1
url: https://test1.startinblox.com
script:
- echo 'Environment is not setup yet...'
- echo "$APP_CONFIG_TEST1" > config.json
- echo "$SSH_ASTRAL_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test1@astral.startinblox.com:~/front/
only:
- feature/*
when: manual
tags:
- sib
- deploy
deploy_review:
stage: prepare_release
deploy_test2:
stage: integration
environment:
name: review
url: https://review.startinblox.com
name: test2
url: https://test2.startinblox.com
script:
- echo "$APP_CONFIG_PARIS_STG" > config.json
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- echo "$APP_CONFIG_TEST2" > config.json
- echo "$SSH_ASTRAL_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test-paris@ssh-test-paris.happy-dev.fr:~/staging/www/
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test2@astral.startinblox.com:~/front/
only:
- dev
- feature/*
when: manual
tags:
- sib
- deploy
deploy_staging:
stage: validate_release
deploy_test3:
stage: integration
environment:
name: staging
url: https://staging.startinblox.com
name: test3
url: https://test3.startinblox.com
script:
- echo 'Environment is not setup yet...'
- echo "$APP_CONFIG_TEST3" > config.json
- echo "$SSH_ASTRAL_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test3@astral.startinblox.com:~/front/
only:
- feature/*
when: manual
tags:
- deploy
deploy_stg1:
stage: acceptance
environment:
name: stg1
url: https://stg1.startinblox.com
script:
- echo "$APP_CONFIG_STG1" > config.json
- echo "$SSH_ASTRAL_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg1@astral.startinblox.com:~/front/
only:
- master
tags:
- sib
- deploy
## LIVE DEPLOYMENT ##
deploy_stg2:
stage: acceptance
environment:
name: stg2
url: https://stg2.startinblox.com
script:
- echo "$APP_CONFIG_STG2" > config.json
- echo "$SSH_ASTRAL_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg2@astral.startinblox.com:~/front/
only:
- master
tags:
- deploy
## LIVE DEPLOYMENTS ##
deploy_nantes:
stage: deploy_production
stage: deployment
environment:
name: nantes
url: https://nantes.happy-dev.fr
script:
- echo "$APP_CONFIG_NANTES" > config.json
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test-paris@ssh-test-paris.happy-dev.fr:~/staging/www/
- echo 'Not happening yet...'
only:
- master
when: manual
tags:
- sib
- deploy
deploy_paris:
stage: deploy_production
stage: deployment
environment:
name: paris
url: https://paris.happy-dev.fr
script:
- echo "$APP_CONFIG_PARIS" > config.json
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test-paris@ssh-test-paris.happy-dev.fr:~/www/
- echo 'Not happening yet...'
only:
- master
when: manual
tags:
- sib
- deploy

View File

@ -1 +0,0 @@
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEw23THoFtbG25dkre20Zx03wTyGtmEiUTANGekdCmCymie9/oGgpwIfsqR3VysaUZqO/ObS8le//mVtQJhkKi4= deploy key