summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-11-09 17:01:35 +1300
committerThong Kuah <tkuah@gitlab.com>2018-11-09 17:01:35 +1300
commit1e367810dc3277338f5dfdf38c27923de9eafab0 (patch)
treea3e386f91b8d060c6cca0cdf802579769870a0ee
parentf44b7ac6b7b241df9b3beaf8386877852efb015b (diff)
downloadgitlab-ce-1e367810dc3277338f5dfdf38c27923de9eafab0.tar.gz
Use except:variables to fix multiple variable jobsauto_devops_kubernetes_active
As `only:variables` has the effect of being satisfied by any one of variable expression - this will create a situation where e.g. the dast job will be active even if there's no cluster. So use `except:variables which requires each and every variable expression to be satisfied.
-rw-r--r--lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml36
1 files changed, 16 insertions, 20 deletions
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
index 1e26d0a2d6a..e50c46f3f3f 100644
--- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
@@ -147,11 +147,10 @@ performance:
only:
refs:
- branches
- variables:
- - $KUBECONFIG
except:
variables:
- $PERFORMANCE_DISABLED
+ - $KUBECONFIG == null
sast:
stage: test
@@ -227,14 +226,13 @@ dast:
refs:
- branches
variables:
- - $KUBECONFIG
- variables:
- $GITLAB_FEATURES =~ /\bdast\b/
except:
refs:
- master
variables:
- $DAST_DISABLED
+ - $KUBECONFIG == null
review:
stage: review
@@ -256,13 +254,12 @@ review:
only:
refs:
- branches
- variables:
- - $KUBECONFIG
except:
refs:
- master
variables:
- $REVIEW_DISABLED
+ - $KUBECONFIG == null
stop_review:
stage: cleanup
@@ -280,13 +277,12 @@ stop_review:
only:
refs:
- branches
- variables:
- - $KUBECONFIG
except:
refs:
- master
variables:
- $REVIEW_DISABLED
+ - $KUBECONFIG == null
# Staging deploys are disabled by default since
# continuous deployment to production is enabled by default
@@ -311,9 +307,10 @@ staging:
refs:
- master
variables:
- - $KUBECONFIG
- variables:
- $STAGING_ENABLED
+ except:
+ variables:
+ - $KUBECONFIG == null
# Canaries are also disabled by default, but if you want them,
# and know what the downsides are, you can enable this by setting
@@ -337,9 +334,10 @@ canary:
refs:
- master
variables:
- - $KUBECONFIG
- variables:
- $CANARY_ENABLED
+ except:
+ variables:
+ - $KUBECONFIG == null
.production: &production_template
stage: production
@@ -365,14 +363,13 @@ production:
only:
refs:
- master
- variables:
- - $KUBECONFIG
except:
variables:
- $STAGING_ENABLED
- $CANARY_ENABLED
- $INCREMENTAL_ROLLOUT_ENABLED
- $INCREMENTAL_ROLLOUT_MODE
+ - $KUBECONFIG == null
production_manual:
<<: *production_template
@@ -382,14 +379,13 @@ production_manual:
refs:
- master
variables:
- - $KUBECONFIG
- variables:
- $STAGING_ENABLED
- $CANARY_ENABLED
except:
variables:
- $INCREMENTAL_ROLLOUT_ENABLED
- $INCREMENTAL_ROLLOUT_MODE
+ - $KUBECONFIG == null
# This job implements incremental rollout on for every push to `master`.
@@ -420,13 +416,12 @@ production_manual:
refs:
- master
variables:
- - $KUBECONFIG
- variables:
- $INCREMENTAL_ROLLOUT_MODE == "manual"
- $INCREMENTAL_ROLLOUT_ENABLED
except:
variables:
- $INCREMENTAL_ROLLOUT_MODE == "timed"
+ - $KUBECONFIG == null
.timed_rollout_template: &timed_rollout_template
<<: *rollout_template
@@ -436,9 +431,10 @@ production_manual:
refs:
- master
variables:
- - $KUBECONFIG
- variables:
- $INCREMENTAL_ROLLOUT_MODE == "timed"
+ except:
+ variables:
+ - $KUBECONFIG == null
timed rollout 10%:
<<: *timed_rollout_template