From 7d382df653a4761c35d6962058f4d6e02f4c9eff Mon Sep 17 00:00:00 2001 From: plup Date: Mon, 2 Dec 2019 21:01:47 +0100 Subject: [PATCH] cicd: added production environment --- .gitlab-ci.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++----- gitlabci.pub | 1 + 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 gitlabci.pub diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a518bcd..695215d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,61 @@ image: node stages: - - deploy + - deploy_staging + - deploy_production -deploy_staging: - stage: deploy - environment: staging +## STAGING ## + +deploy_paris_stg: + stage: deploy_staging + environment: + name: paris_stg + url: https://staging.test-paris.happy-dev.fr 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 - 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 + +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: - sib diff --git a/gitlabci.pub b/gitlabci.pub new file mode 100644 index 0000000..48ad393 --- /dev/null +++ b/gitlabci.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEw23THoFtbG25dkre20Zx03wTyGtmEiUTANGekdCmCymie9/oGgpwIfsqR3VysaUZqO/ObS8le//mVtQJhkKi4= deploy key