Created
June 23, 2017 13:42
-
-
Save kelchm/fc8ca06dd3e44a42fa640ed7a8e8429e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
COMPOSE_FILE: "docker-compose.rancher.yml" | |
TRAEFIK_ENABLED: "true" | |
STACK_NAME: $CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG | |
stages: | |
- build | |
- deploy | |
- cleanup | |
build: | |
stage: build | |
script: | |
- build | |
deploy_devevelopment: | |
stage: deploy | |
variables: | |
RANCHER_ENVIRONMENT: development | |
script: | |
- deploy | |
environment: | |
name: development/$CI_COMMIT_REF_SLUG | |
url: http://web.$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG.$RANCHER_ENVIRONMENT.$RANCHER_FQDN | |
on_stop: stop_development | |
only: | |
- branches | |
except: | |
- master | |
stop_development: | |
stage: cleanup | |
variables: | |
RANCHER_ENVIRONMENT: development | |
script: | |
- destroy | |
environment: | |
name: development/$CI_COMMIT_REF_SLUG | |
action: stop | |
when: manual | |
only: | |
- branches | |
except: | |
- master | |
deploy_staging: | |
stage: deploy | |
variables: | |
RANCHER_ENVIRONMENT: staging | |
STACK_NAME: $CI_PROJECT_NAME | |
script: | |
- deploy | |
environment: | |
name: staging | |
url: http://web.$CI_PROJECT_NAME.$RANCHER_ENVIRONMENT.$RANCHER_FQDN | |
only: | |
- master | |
deploy_production: | |
stage: deploy | |
variables: | |
RANCHER_ENVIRONMENT: production | |
STACK_NAME: $CI_PROJECT_NAME | |
script: | |
- deploy | |
environment: | |
name: production | |
url: http://web.$CI_PROJECT_NAME.$RANCHER_ENVIRONMENT.$RANCHER_FQDN | |
when: manual | |
only: | |
- /^v.*$/ | |
except: | |
- branches | |
- triggers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment