From f342bb36f13fa97d06ed4513e532ab2e9ddc002e Mon Sep 17 00:00:00 2001
From: Mark Pundsack <mpundsack@gitlab.com>
Date: Wed, 19 Apr 2017 16:56:17 -0500
Subject: [PATCH 1/2] Add Kubernetes canary template

---
 .../Kubernetes-with-canary.gitlab-ci.yml      | 86 +++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 autodeploy/Kubernetes-with-canary.gitlab-ci.yml

diff --git a/autodeploy/Kubernetes-with-canary.gitlab-ci.yml b/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
new file mode 100644
index 0000000..f290007
--- /dev/null
+++ b/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
@@ -0,0 +1,86 @@
+# Explanation on the scripts:
+# https://gitlab.com/gitlab-examples/kubernetes-deploy/blob/master/README.md
+image: registry.gitlab.com/gitlab-examples/kubernetes-deploy
+
+variables:
+  # Application deployment domain
+  KUBE_DOMAIN: domain.example.com
+
+stages:
+  - build
+  - test
+  - review
+  - staging
+  - canary
+  - production
+  - cleanup
+
+build:
+  stage: build
+  script:
+    - command build
+  only:
+    - branches
+
+canary:
+  stage: canary
+  script:
+    - command canary
+  environment:
+    name: production
+    url: http://$CI_PROJECT_NAME.$KUBE_DOMAIN
+  when: manual
+  allow_failure: false
+  only:
+    - master
+
+production:
+  stage: production
+  script:
+    - command deploy
+  environment:
+    name: production
+    url: http://$CI_PROJECT_NAME.$KUBE_DOMAIN
+  when: manual
+  allow_failure: false
+  only:
+    - master
+
+staging:
+  stage: staging
+  script:
+    - command deploy
+  environment:
+    name: staging
+    url: http://$CI_PROJECT_NAME-staging.$KUBE_DOMAIN
+  only:
+    - master
+
+review:
+  stage: review
+  script:
+    - command deploy
+  environment:
+    name: review/$CI_COMMIT_REF_SLUG
+    url: http://$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
+    on_stop: stop_review
+  only:
+    - branches
+  except:
+    - master
+
+stop_review:
+  stage: cleanup
+  variables:
+    GIT_STRATEGY: none
+  script:
+    - command destroy
+  environment:
+    name: review/$CI_COMMIT_REF_SLUG
+    action: stop
+  when: manual
+  allow_failure: true
+  only:
+    - branches
+  except:
+    - master
-- 
GitLab


From 30371baac527c7c8e11334a44ec01dfec7cc9fc7 Mon Sep 17 00:00:00 2001
From: "Z.J. van de Weg" <git@zjvandeweg.nl>
Date: Thu, 20 Apr 2017 09:26:37 +0200
Subject: [PATCH 2/2] Remove implicit values

---
 autodeploy/Kubernetes-with-canary.gitlab-ci.yml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/autodeploy/Kubernetes-with-canary.gitlab-ci.yml b/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
index f290007..ed77fd8 100644
--- a/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
+++ b/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
@@ -30,7 +30,6 @@ canary:
     name: production
     url: http://$CI_PROJECT_NAME.$KUBE_DOMAIN
   when: manual
-  allow_failure: false
   only:
     - master
 
@@ -42,7 +41,6 @@ production:
     name: production
     url: http://$CI_PROJECT_NAME.$KUBE_DOMAIN
   when: manual
-  allow_failure: false
   only:
     - master
 
-- 
GitLab