diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-01 15:03:48 +0200 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-05 21:14:59 +0200 |
commit | 94fc0619365c7df284a29e76b1abc194a266efc2 (patch) | |
tree | 60770d1ed6013416831c0795ee66f30a3eb71760 /lib | |
parent | 1a90632cc9555d06edfa3a86808ab65f47558be9 (diff) | |
download | gitlab-ce-94fc0619365c7df284a29e76b1abc194a266efc2.tar.gz |
Add timed incremental rollout to Auto DevOps
Auto DevOps deployment strategies now supports timed incremental
rollout. We are deprecating the usage of INCREMENTAL_ROLLOUT_ENABLED
environment variable in Auto DevOps template.
The new behavior will be driven by the INCREMENTAL_ROLLOUT_MODE variable
that can either be manual (same as INCREMENTAL_ROLLOUT_ENABLED) or
timed.
Rollout deployments will be executed using a 5 minute delay between each
job.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml | 88 |
1 files changed, 57 insertions, 31 deletions
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml index ed4ec7e6385..72547c1b407 100644 --- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml @@ -25,8 +25,9 @@ # level, or manually added below. # # Continuous deployment to production is enabled by default. -# If you want to deploy to staging first, or enable incremental rollouts, -# set STAGING_ENABLED or INCREMENTAL_ROLLOUT_ENABLED environment variables. +# If you want to deploy to staging first, set STAGING_ENABLED environment variable. +# If you want to enable incremental rollout, either manual or time based, +# set INCREMENTAL_ROLLOUT_TYPE environment variable to "manual" or "timed". # If you want to use canary deployments, set CANARY_ENABLED environment variable. # # If Auto DevOps fails to detect the proper buildpack, or if you want to @@ -61,6 +62,10 @@ stages: - staging - canary - production + - incremental rollout 10% + - incremental rollout 25% + - incremental rollout 50% + - incremental rollout 100% - performance - cleanup @@ -282,11 +287,6 @@ stop_review: variables: - $REVIEW_DISABLED -# Keys that start with a dot (.) will not be processed by GitLab CI. -# Staging and canary jobs are disabled by default, to enable them -# remove the dot (.) before the job name. -# https://docs.gitlab.com/ee/ci/yaml/README.html#hidden-keys - # Staging deploys are disabled by default since # continuous deployment to production is enabled by default # If you prefer to automatically deploy to staging and @@ -368,6 +368,7 @@ production: - $STAGING_ENABLED - $CANARY_ENABLED - $INCREMENTAL_ROLLOUT_ENABLED + - $INCREMENTAL_ROLLOUT_MODE production_manual: <<: *production_template @@ -383,11 +384,11 @@ production_manual: except: variables: - $INCREMENTAL_ROLLOUT_ENABLED + - $INCREMENTAL_ROLLOUT_MODE # This job implements incremental rollout on for every push to `master`. .rollout: &rollout_template - stage: production script: - check_kube_domain - install_dependencies @@ -405,52 +406,77 @@ production_manual: artifacts: paths: [environment_url.txt] -rollout 10%: +.manual_rollout_template: &manual_rollout_template <<: *rollout_template - variables: - ROLLOUT_PERCENTAGE: 10 + stage: production when: manual + # This selectors are backward compatible mode with $INCREMENTAL_ROLLOUT_ENABLED (before 11.4) only: refs: - master kubernetes: active variables: + - $INCREMENTAL_ROLLOUT_MODE == "manual" - $INCREMENTAL_ROLLOUT_ENABLED + except: + variables: + - $INCREMENTAL_ROLLOUT_MODE == "timed" -rollout 25%: +.timed_rollout_template: &timed_rollout_template <<: *rollout_template - variables: - ROLLOUT_PERCENTAGE: 25 - when: manual + when: delayed + start_in: 5 minutes only: refs: - master kubernetes: active variables: - - $INCREMENTAL_ROLLOUT_ENABLED + - $INCREMENTAL_ROLLOUT_MODE == "timed" + +timed rollout 10%: + <<: *timed_rollout_template + stage: incremental rollout 10% + variables: + ROLLOUT_PERCENTAGE: 10 + +timed rollout 25%: + <<: *timed_rollout_template + stage: incremental rollout 25% + variables: + ROLLOUT_PERCENTAGE: 25 + +timed rollout 50%: + <<: *timed_rollout_template + stage: incremental rollout 50% + variables: + ROLLOUT_PERCENTAGE: 50 + +timed rollout 100%: + <<: *timed_rollout_template + <<: *production_template + stage: incremental rollout 100% + variables: + ROLLOUT_PERCENTAGE: 100 + +rollout 10%: + <<: *manual_rollout_template + variables: + ROLLOUT_PERCENTAGE: 10 + +rollout 25%: + <<: *manual_rollout_template + variables: + ROLLOUT_PERCENTAGE: 25 rollout 50%: - <<: *rollout_template + <<: *manual_rollout_template variables: ROLLOUT_PERCENTAGE: 50 - when: manual - only: - refs: - - master - kubernetes: active - variables: - - $INCREMENTAL_ROLLOUT_ENABLED rollout 100%: + <<: *manual_rollout_template <<: *production_template - when: manual allow_failure: false - only: - refs: - - master - kubernetes: active - variables: - - $INCREMENTAL_ROLLOUT_ENABLED # --------------------------------------------------------------------------- |