2017-09-08 05:28:40 -04:00
|
|
|
# This template has been DEPRECATED. Consider using Auto DevOps instead:
|
|
|
|
# https://docs.gitlab.com/ee/topics/autodevops
|
|
|
|
|
2017-02-07 00:03:05 -05:00
|
|
|
# Explanation on the scripts:
|
2017-01-22 06:22:31 -05:00
|
|
|
# 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
|
|
|
|
- production
|
2017-03-08 18:16:47 -05:00
|
|
|
- cleanup
|
2017-01-22 06:22:31 -05:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- command build
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
|
|
|
|
production:
|
|
|
|
stage: production
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
|
|
|
name: production
|
2017-07-11 08:39:38 -04:00
|
|
|
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
|
2017-01-22 06:22:31 -05:00
|
|
|
when: manual
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
staging:
|
|
|
|
stage: staging
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
|
|
|
name: staging
|
2017-07-11 08:39:38 -04:00
|
|
|
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_DOMAIN
|
2017-01-22 06:22:31 -05:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
review:
|
|
|
|
stage: review
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
2017-03-10 05:41:37 -05:00
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
2017-07-11 08:39:38 -04:00
|
|
|
url: http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
|
2017-01-22 06:22:31 -05:00
|
|
|
on_stop: stop_review
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
except:
|
|
|
|
- master
|
|
|
|
|
|
|
|
stop_review:
|
2017-03-08 18:16:47 -05:00
|
|
|
stage: cleanup
|
2017-01-22 06:22:31 -05:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
script:
|
|
|
|
- command destroy
|
|
|
|
environment:
|
2017-03-10 05:41:37 -05:00
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
2017-01-22 06:22:31 -05:00
|
|
|
action: stop
|
|
|
|
when: manual
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
except:
|
|
|
|
- master
|