Files
exchange/.gitlab-ci.yml
Jack Goh e2ae54a8eb remove build frontend because too slow
fix public file 404
2018-08-07 19:28:50 +08:00

35 lines
919 B
YAML

before_script:
- bash .gitlab-ci.sh
stages:
- testing
- staging
variables:
MYSQL_DATABASE: default
MYSQL_USER: default
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
unitTesting:
stage: testing
image: php:7.2.6
services:
- mysql:5.7
script:
- vendor/bin/phpunit --coverage-text --colors=never
staging:
stage: staging
before_script:
- mkdir -p ~/.ssh
- echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh izyim@40.76.84.105 "cd exchange && git add . && git commit -am "merge staging" && git pull origin master && sudo docker-compose -f docker-prod.yml build && sudo docker-compose -f docker-prod.yml up -d"
environment:
name: staging
url: https://exchange-staging.izyim.com/
when: manual