cicd: added production environment

This commit is contained in:
plup 2019-12-02 21:01:47 +01:00
parent 5e8557f84d
commit 7d382df653
2 changed files with 49 additions and 5 deletions

View File

@ -1,18 +1,61 @@
image: node image: node
stages: stages:
- deploy - deploy_staging
- deploy_production
deploy_staging: ## STAGING ##
stage: deploy
environment: staging deploy_paris_stg:
stage: deploy_staging
environment:
name: paris_stg
url: https://staging.test-paris.happy-dev.fr
script: script:
- echo "$APP_CONFIG" > config.json - echo "$APP_CONFIG_PARIS_STG" > config.json
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key - echo "$SSH_PRIVATE_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm install - npm install
- npm run build - 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/* test-paris@ssh-test-paris.happy-dev.fr:~/staging/www/
only: only:
- staging - staging
- feat/manager_deploy
tags:
- sib
deploy_nantes:
stage: deploy_staging
environment:
name: nantes
url: https://test-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/
only:
- staging
- feat/manager_deploy
tags:
- sib
## PRODUCTION ##
deploy_paris:
stage: deploy_production
environment:
name: paris
url: https://test-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/
only:
- staging
- feat/manager_deploy
when: manual
tags: tags:
- sib - sib

1
gitlabci.pub Normal file
View File

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