Files
c-cms-legacy/.gitlab-ci.yml
2020-08-03 15:50:53 +00:00

118 lines
2.9 KiB
YAML

image: registry.gitlab.com/thegamecraft/c-cms:latest
services:
- mysql:5.7
variables:
MYSQL_DATABASE: ddb
MYSQL_ROOT_PASSWORD: password
DB_HOST: mysql
DB_USERNAME: root
stages:
- build
- test
- deploy
unit_test:
stage: test
script:
- cp .env.example .env
- composer install
- php artisan key:generate
- php artisan migrate
- php artisan db:seed
- vendor/bin/phpunit
build:
stage: build
script:
- cp .env.example .env
- composer install
- php artisan key:generate
deploy_697:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy_697 --commit="$CI_COMMIT_SHA"
environment:
name: escadron697
url: http://escadron697.ca
when: manual
only:
- master
deploy_736:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy_736 --commit="$CI_COMMIT_SHA"
environment:
name: escadron736
url: http://736.exvps.ca
when: manual
only:
- master
deploy_227:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy_227 --commit="$CI_COMMIT_SHA"
environment:
name: CCMRC227
url: http://227.exvps.ca
when: manual
only:
- master
deploy_117:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy_117 --commit="$CI_COMMIT_SHA"
environment:
name: CCMRC117
url: http://117.exvps.ca
when: manual
only:
- master
deploy_dev:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy_dev --commit="$CI_COMMIT_SHA"
environment:
name: dev
url: http://dev.exvps.ca
when: manual
only:
- dev