Config deploy + review

This commit is contained in:
Meutel 2017-04-02 16:29:01 +02:00
parent 3a97b1dde8
commit 8e813bf736
1 changed files with 76 additions and 7 deletions

View File

@ -1,11 +1,80 @@
pages:
stage: deploy
stages:
- build
- review
- staging
- production
build:
stage: build
script:
- mkdir .public
- cp -r * .public
- mv .public public
- echo Build my page
artifacts:
paths:
- public
- public
expire_in: 1 hour
tags:
- nginx
- review-apps
- deploy
review:
stage: review
script:
- rsync -av --delete public /usr/local/www/www_home/review/$CI_BUILD_REF_SLUG
environment:
name: review/$CI_BUILD_REF_NAME
url: http://$CI_BUILD_REF_SLUG.$APPS_DOMAIN
on_stop: stop_review
only:
- master
- branches
except:
- master
tags:
- nginx
- review-apps
- deploy
stop_review:
stage: review
script:
- rm -rf public/*
- rsync -av --delete public /usr/local/www/www_home/review/$CI_BUILD_REF_SLUG
variables:
GIT_STRATEGY: none
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
tags:
- nginx
- review-apps
- deploy
staging:
stage: staging
script:
- rsync -av --delete public /usr/local/www/www_home/staging
environment:
name: staging
url: http://staging.$APPS_DOMAIN
only:
- master
tags:
- nginx
- review-apps
- deploy
production:
stage: production
script:
- rsync -av --delete public /usr/local/www/www_home/production
environment:
name: production
url: https://$APPS_DOMAIN
when: manual
only:
- master
tags:
- nginx
- review-apps
- deploy