Skip to content
Snippets Groups Projects
Commit f342bb36 authored by Mark Pundsack's avatar Mark Pundsack
Browse files

Add Kubernetes canary template

parent 14dc6bcb
No related branches found
No related tags found
1 merge request!70Add Kubernetes canary template
Pipeline #
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment