From 52f13148b67242cc623f0e91e74efabea763edf0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Wed, 7 Jul 2021 08:17:42 -0400 Subject: [PATCH] Set up a deploy job for production too --- .gitlab-ci.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f57e1f1..7c0c5ae6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,13 +69,9 @@ system-tests: script: - "nix-shell --run 'nix-build nixos/system-tests.nix'" -deploy-to-staging: +# A template for a job that can update one of the grids. +.update-grid: &UPDATE_GRID stage: "deploy" - only: - - "staging" - environment: - name: "staging" - url: "https://privatestorage-staging.com/" script: # Announce our intentions. - | @@ -102,13 +98,20 @@ deploy-to-staging: - | rm -v "${KEY_PATH}" +# Update the staging deployment - only on a merge to the staging branch. +update-staging: + <<: *UPDATE_GRID + only: + - "staging" + environment: + name: "staging" + url: "https://privatestorage-staging.com/" + +# Update the production deployment - only on a merge to the production branch. deploy-to-production: - stage: "deploy" + <<: *UPDATE_GRID only: - "production" environment: name: "production" url: "https://privatestorage.io/" - script: - - echo "Hello $GITLAB_USER_LOGIN from $CI_JOB_NAME. I was triggered by $CI_PIPELINE_SOURCE " - - echo "and would like to deploy the $CI_COMMIT_BRANCH branch to the $CI_ENVIRONMENT_NAME environment." -- GitLab