Commit 1674b4b1 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason

Simplify CI_DEPLOY_FREEZE conditions in Auto DevOps

There's no need to compare against null, because null is a falsy value
in rules:if.

See https://gitlab.com/gitlab-org/gitlab/-/issues/351928

Changelog: changed
parent 9daac084
......@@ -103,7 +103,7 @@ canary:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -135,7 +135,7 @@ canary:
production:
<<: *production_template
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -153,7 +153,7 @@ production_manual:
<<: *production_template
allow_failure: false
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -192,7 +192,7 @@ production_manual:
resource_group: production
allow_failure: true
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -207,7 +207,7 @@ production_manual:
.timed_rollout_template: &timed_rollout_template
<<: *rollout_template
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......
......@@ -103,7 +103,7 @@ canary:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -135,7 +135,7 @@ canary:
production:
<<: *production_template
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -153,7 +153,7 @@ production_manual:
<<: *production_template
allow_failure: false
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -192,7 +192,7 @@ production_manual:
resource_group: production
allow_failure: true
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......@@ -207,7 +207,7 @@ production_manual:
.timed_rollout_template: &timed_rollout_template
<<: *rollout_template
rules:
- if: '$CI_DEPLOY_FREEZE != null'
- if: '$CI_DEPLOY_FREEZE'
when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
......
......@@ -66,6 +66,11 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
expect(build_names).not_to include('review')
end
it 'when CI_DEPLOY_FREEZE is present' do
create(:ci_variable, project: project, key: 'CI_DEPLOY_FREEZE', value: 'true')
expect(build_names).to eq %w(placeholder)
end
it 'when CANARY_ENABLED' do
create(:ci_variable, project: project, key: 'CANARY_ENABLED', value: 'true')
......
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