Commit 42ef30b8 authored by Pavel Shutsin's avatar Pavel Shutsin

Merge branch 'simplify-ci-deploy-freeze-condition' into 'master'

Simplify CI_DEPLOY_FREEZE conditions in Auto DevOps

See merge request gitlab-org/gitlab!79976
parents e19cb3b1 1674b4b1
...@@ -103,7 +103,7 @@ canary: ...@@ -103,7 +103,7 @@ canary:
name: production name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -135,7 +135,7 @@ canary: ...@@ -135,7 +135,7 @@ canary:
production: production:
<<: *production_template <<: *production_template
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -153,7 +153,7 @@ production_manual: ...@@ -153,7 +153,7 @@ production_manual:
<<: *production_template <<: *production_template
allow_failure: false allow_failure: false
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -192,7 +192,7 @@ production_manual: ...@@ -192,7 +192,7 @@ production_manual:
resource_group: production resource_group: production
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -207,7 +207,7 @@ production_manual: ...@@ -207,7 +207,7 @@ production_manual:
.timed_rollout_template: &timed_rollout_template .timed_rollout_template: &timed_rollout_template
<<: *rollout_template <<: *rollout_template
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
......
...@@ -103,7 +103,7 @@ canary: ...@@ -103,7 +103,7 @@ canary:
name: production name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -135,7 +135,7 @@ canary: ...@@ -135,7 +135,7 @@ canary:
production: production:
<<: *production_template <<: *production_template
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -153,7 +153,7 @@ production_manual: ...@@ -153,7 +153,7 @@ production_manual:
<<: *production_template <<: *production_template
allow_failure: false allow_failure: false
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -192,7 +192,7 @@ production_manual: ...@@ -192,7 +192,7 @@ production_manual:
resource_group: production resource_group: production
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
...@@ -207,7 +207,7 @@ production_manual: ...@@ -207,7 +207,7 @@ production_manual:
.timed_rollout_template: &timed_rollout_template .timed_rollout_template: &timed_rollout_template
<<: *rollout_template <<: *rollout_template
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE'
when: never when: never
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
......
...@@ -66,6 +66,11 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do ...@@ -66,6 +66,11 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
expect(build_names).not_to include('review') expect(build_names).not_to include('review')
end 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 it 'when CANARY_ENABLED' do
create(:ci_variable, project: project, key: 'CANARY_ENABLED', value: 'true') 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