Commit 54f36f79 authored by Kamil Trzciński's avatar Kamil Trzciński
Browse files

Merge branch...

Merge branch '38549-variables-to-define-deploy-policy-for-staging-and-production-environments' into 'master'

Use variables to define deploy policy for staging and production environments

Closes gitlab-ce#38549

See merge request !160
parents a3ac3086 b4cdfa2f
Loading
Loading
Loading
Loading
Loading
+20 −3
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ stop_review:
# only manually promote to production, enable this job by removing the dot (.),
# only manually promote to production, enable this job by removing the dot (.),
# and uncomment the `when: manual` line in the `production` job.
# and uncomment the `when: manual` line in the `production` job.


.staging:
staging:
  stage: staging
  stage: staging
  script:
  script:
    - check_kube_domain
    - check_kube_domain
@@ -234,6 +234,8 @@ stop_review:
    refs:
    refs:
      - master
      - master
    kubernetes: active
    kubernetes: active
    variables:
      - $STAGING_ENABLED


# Canaries are disabled by default, but if you want them,
# Canaries are disabled by default, but if you want them,
# and know what the downsides are, enable this job by removing the dot (.),
# and know what the downsides are, enable this job by removing the dot (.),
@@ -263,7 +265,7 @@ stop_review:
# or `canary` deploys, or you simply want more control over when you deploy
# or `canary` deploys, or you simply want more control over when you deploy
# to production, uncomment the `when: manual` line in the `production` job.
# to production, uncomment the `when: manual` line in the `production` job.


production:
.production: &production_template
  stage: production
  stage: production
  script:
  script:
    - check_kube_domain
    - check_kube_domain
@@ -280,11 +282,26 @@ production:
    url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
    url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
  artifacts:
  artifacts:
    paths: [environment_url.txt]
    paths: [environment_url.txt]
#  when: manual

production:
  <<: *production_template
  only:
  only:
    refs:
    refs:
      - master
      - master
    kubernetes: active
    kubernetes: active
  except:
    variables:
      - $STAGING_ENABLED

production_manual:
  <<: *production_template
  when: manual
  only:
    refs:
      - master
    kubernetes: active
    variables:
      - $STAGING_ENABLED


# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------