Commit 6dffbec1 authored by Mayra Cabrera's avatar Mayra Cabrera 0️⃣
Browse files

Refactor production job to remove duplication

parent a7e18757
Loading
Loading
Loading
Loading
Loading
+6 −18
Original line number Original line Diff line number Diff line
@@ -265,7 +265,7 @@ staging:
# 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
@@ -282,6 +282,9 @@ 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]

production:
  <<: *production_template
  only:
  only:
    refs:
    refs:
      - master
      - master
@@ -291,22 +294,7 @@ production:
      - $STAGING_ENABLED
      - $STAGING_ENABLED


production_manual:
production_manual:
  stage: production
  <<: *production_template
  script:
    - check_kube_domain
    - install_dependencies
    - download_chart
    - ensure_namespace
    - install_tiller
    - create_secret
    - deploy
    - delete canary
    - persist_environment_url
  environment:
    name: production
    url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
  artifacts:
    paths: [environment_url.txt]
  when: manual
  when: manual
  only:
  only:
    refs:
    refs: