2018-03-17 18:26:18 +05:30
|
|
|
# This template has been DEPRECATED. Consider using Auto DevOps instead:
|
|
|
|
# https://docs.gitlab.com/ee/topics/autodevops
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
# Explanation on the scripts:
|
|
|
|
# https://gitlab.com/gitlab-examples/openshift-deploy/blob/master/README.md
|
|
|
|
image: registry.gitlab.com/gitlab-examples/openshift-deploy
|
|
|
|
|
|
|
|
variables:
|
|
|
|
# Application deployment domain
|
|
|
|
KUBE_DOMAIN: domain.example.com
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- review
|
|
|
|
- staging
|
|
|
|
- production
|
|
|
|
- cleanup
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- command build
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
|
|
|
|
production:
|
|
|
|
stage: production
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
|
|
|
name: production
|
2017-09-10 17:25:29 +05:30
|
|
|
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
|
2017-08-17 22:00:37 +05:30
|
|
|
when: manual
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
staging:
|
|
|
|
stage: staging
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
|
|
|
name: staging
|
2017-09-10 17:25:29 +05:30
|
|
|
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_DOMAIN
|
2017-08-17 22:00:37 +05:30
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
review:
|
|
|
|
stage: review
|
|
|
|
script:
|
|
|
|
- command deploy
|
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
2017-09-10 17:25:29 +05:30
|
|
|
url: http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
|
2017-08-17 22:00:37 +05:30
|
|
|
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_NAME
|
|
|
|
action: stop
|
|
|
|
when: manual
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
except:
|
|
|
|
- master
|