-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (60 loc) · 1.52 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# docker image
image: chilio/laravel-dusk-ci:php-7.3
# Pick zero or more services to be used on all builds.
services:
- mysql:5.7
variables:
MYSQL_ROOT_PASSWORD: crmUAM
MYSQL_DATABASE: crm
MYSQL_USER: crm
MYSQL_PASSWORD: crmUAM
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
key: ${CI_BUILD_REF_NAME}
paths:
- vendor
- node_modules
before_script:
# Update Composer
- composer self-update
# Install project dependencies.
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- chmod -R 775 storage
- chmod 775 bootstrap/cache
- chown -R www-data ./
# Copy over testing configuration.
- cp .env.gitlab .env
# Generate an application key. Re-cache.
- php artisan key:generate
- php artisan config:cache
- php artisan config:clear
# Run database migrations.
- php artisan migrate --seed
# Other configurations
- start-nginx-ci-project
test:
script:
# run tests
- echo "Running PHPUnit Tests"
- php artisan test --color
- echo "Running Laravel Dusk"
- chromedriver &
- php artisan dusk --colors --debug
artifacts:
paths:
- ./storage/logs
# for debugging
- ./tests/Browser/screenshots
- ./tests/Browser/console
expire_in: 7 days
when: always
deploy:
stage: deploy
script:
- apt-get update -yq
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --app=crmuam --api-key=$HEROKU_API_KEY
only:
- master