-
Notifications
You must be signed in to change notification settings - Fork 145
/
.gitlab-ci.yml
53 lines (46 loc) · 1.17 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
image: alefesouza/php7-laravel-node-yarn
services:
- mysql:5.7.20
variables:
MYSQL_DATABASE: laravel_vue_boilerplate
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
DB_HOST: mysql
DB_USERNAME: root
DB_PASSWORD: ''
before_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'
cache:
paths:
- node_modules/
- vendor/
stages:
- test
- deploy
unit_test:
stage: test
except:
- deploy
script:
- composer start
- npm start
deploy_production:
stage: deploy
environment:
name: production
url: $PRODUCTION_URL
only:
- master
script:
# Comment the following two lines if you can
# compile front-end stuff on your webserver,
# otherwise it will compile on GitLab CI and
# push it to a deploy branch, also remove the
# deploy branch on the Envoy.blade.php file
- chmod +x ./build/deploy.sh
- ./build/deploy.sh
# Run Envoy via composer to pull the changes on the deploy server
- composer run deploy