mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
modify gitlab-ci.yml
This commit is contained in:
+38
-15
@@ -1,17 +1,40 @@
|
||||
before_script:
|
||||
- bash .gitlab-ci.sh
|
||||
stages:
|
||||
- testing
|
||||
- staging
|
||||
image: registry.gitlab.com/ciefworldwidesdnbhd/exchange:tag
|
||||
|
||||
services:
|
||||
- mysql:5.7
|
||||
|
||||
variables:
|
||||
MYSQL_DATABASE: default
|
||||
MYSQL_USER: default
|
||||
MYSQL_PASSWORD: secret
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
unitTesting:
|
||||
stage: testing
|
||||
image: php:7.0.13
|
||||
services:
|
||||
- mysql:5.7
|
||||
MYSQL_DATABASE: homestead
|
||||
MYSQL_ROOT_PASSWORD: secret
|
||||
DB_HOST: mysql
|
||||
DB_USERNAME: root
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
|
||||
unit_test:
|
||||
stage: test
|
||||
script:
|
||||
- vendor/bin/phpunit --coverage-text --colors=never --configuration phpunit.xml
|
||||
- cp .env.example .env
|
||||
- composer install
|
||||
- php artisan key:generate
|
||||
- php artisan migrate
|
||||
- vendor/bin/phpunit
|
||||
|
||||
deploy_production:
|
||||
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
|
||||
environment:
|
||||
name: production
|
||||
url: http://192.168.1.1
|
||||
when: manual
|
||||
only:
|
||||
- master
|
||||
Reference in New Issue
Block a user