Commit 1e367810 authored by Thong Kuah's avatar Thong Kuah

Use except:variables to fix multiple variable jobs

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.
parent f44b7ac6
...@@ -147,11 +147,10 @@ performance: ...@@ -147,11 +147,10 @@ performance:
only: only:
refs: refs:
- branches - branches
variables:
- $KUBECONFIG
except: except:
variables: variables:
- $PERFORMANCE_DISABLED - $PERFORMANCE_DISABLED
- $KUBECONFIG == null
sast: sast:
stage: test stage: test
...@@ -226,8 +225,6 @@ dast: ...@@ -226,8 +225,6 @@ dast:
only: only:
refs: refs:
- branches - branches
variables:
- $KUBECONFIG
variables: variables:
- $GITLAB_FEATURES =~ /\bdast\b/ - $GITLAB_FEATURES =~ /\bdast\b/
except: except:
...@@ -235,6 +232,7 @@ dast: ...@@ -235,6 +232,7 @@ dast:
- master - master
variables: variables:
- $DAST_DISABLED - $DAST_DISABLED
- $KUBECONFIG == null
review: review:
stage: review stage: review
...@@ -256,13 +254,12 @@ review: ...@@ -256,13 +254,12 @@ review:
only: only:
refs: refs:
- branches - branches
variables:
- $KUBECONFIG
except: except:
refs: refs:
- master - master
variables: variables:
- $REVIEW_DISABLED - $REVIEW_DISABLED
- $KUBECONFIG == null
stop_review: stop_review:
stage: cleanup stage: cleanup
...@@ -280,13 +277,12 @@ stop_review: ...@@ -280,13 +277,12 @@ stop_review:
only: only:
refs: refs:
- branches - branches
variables:
- $KUBECONFIG
except: except:
refs: refs:
- master - master
variables: variables:
- $REVIEW_DISABLED - $REVIEW_DISABLED
- $KUBECONFIG == null
# Staging deploys are disabled by default since # Staging deploys are disabled by default since
# continuous deployment to production is enabled by default # continuous deployment to production is enabled by default
...@@ -310,10 +306,11 @@ staging: ...@@ -310,10 +306,11 @@ staging:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
variables: variables:
- $STAGING_ENABLED - $STAGING_ENABLED
except:
variables:
- $KUBECONFIG == null
# Canaries are also disabled by default, but if you want them, # Canaries are also disabled by default, but if you want them,
# and know what the downsides are, you can enable this by setting # and know what the downsides are, you can enable this by setting
...@@ -336,10 +333,11 @@ canary: ...@@ -336,10 +333,11 @@ canary:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
variables: variables:
- $CANARY_ENABLED - $CANARY_ENABLED
except:
variables:
- $KUBECONFIG == null
.production: &production_template .production: &production_template
stage: production stage: production
...@@ -365,14 +363,13 @@ production: ...@@ -365,14 +363,13 @@ production:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
except: except:
variables: variables:
- $STAGING_ENABLED - $STAGING_ENABLED
- $CANARY_ENABLED - $CANARY_ENABLED
- $INCREMENTAL_ROLLOUT_ENABLED - $INCREMENTAL_ROLLOUT_ENABLED
- $INCREMENTAL_ROLLOUT_MODE - $INCREMENTAL_ROLLOUT_MODE
- $KUBECONFIG == null
production_manual: production_manual:
<<: *production_template <<: *production_template
...@@ -381,8 +378,6 @@ production_manual: ...@@ -381,8 +378,6 @@ production_manual:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
variables: variables:
- $STAGING_ENABLED - $STAGING_ENABLED
- $CANARY_ENABLED - $CANARY_ENABLED
...@@ -390,6 +385,7 @@ production_manual: ...@@ -390,6 +385,7 @@ production_manual:
variables: variables:
- $INCREMENTAL_ROLLOUT_ENABLED - $INCREMENTAL_ROLLOUT_ENABLED
- $INCREMENTAL_ROLLOUT_MODE - $INCREMENTAL_ROLLOUT_MODE
- $KUBECONFIG == null
# This job implements incremental rollout on for every push to `master`. # This job implements incremental rollout on for every push to `master`.
...@@ -419,14 +415,13 @@ production_manual: ...@@ -419,14 +415,13 @@ production_manual:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
variables: variables:
- $INCREMENTAL_ROLLOUT_MODE == "manual" - $INCREMENTAL_ROLLOUT_MODE == "manual"
- $INCREMENTAL_ROLLOUT_ENABLED - $INCREMENTAL_ROLLOUT_ENABLED
except: except:
variables: variables:
- $INCREMENTAL_ROLLOUT_MODE == "timed" - $INCREMENTAL_ROLLOUT_MODE == "timed"
- $KUBECONFIG == null
.timed_rollout_template: &timed_rollout_template .timed_rollout_template: &timed_rollout_template
<<: *rollout_template <<: *rollout_template
...@@ -435,10 +430,11 @@ production_manual: ...@@ -435,10 +430,11 @@ production_manual:
only: only:
refs: refs:
- master - master
variables:
- $KUBECONFIG
variables: variables:
- $INCREMENTAL_ROLLOUT_MODE == "timed" - $INCREMENTAL_ROLLOUT_MODE == "timed"
except:
variables:
- $KUBECONFIG == null
timed rollout 10%: timed rollout 10%:
<<: *timed_rollout_template <<: *timed_rollout_template
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment