-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
101 lines (91 loc) · 2.34 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
image: registry.gitlab.com/biscofil/thelios:no_user
services:
- mysql:8
variables:
# Configure mysql environment variables (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: your_mysql_root_password
DB_HOST: mysql
DB_USERNAME: root
stages:
- test
# - build
# - deploy
php_test:
stage: test
coverage: &cov '/^\s*Lines:\s*(\d+.\d+)\%/'
# Cache libraries in between jobs
cache:
key: composer_cache
paths:
- vendor/
before_script:
- cp .env.example .env
- cp db.env.example db.env
- composer install
- rm bootstrap/cache/*
- php artisan config:clear
- php artisan cache:clear
- php artisan route:clear
- php artisan view:clear
- php artisan key:generate
- php artisan migrate
- php artisan db:seed
- php artisan generate:jwt-keypair
- php artisan config:cache
- php artisan route:cache
script:
- echo PHPUNIT TEST
- vendor/phpunit/phpunit/phpunit tests/ --coverage-text --colors=never --configuration phpunit_gitlab.xml
db_test:
stage: test
before_script:
- cp .env.example .env
- composer install
- php artisan key:generate
- php artisan config:cache
script:
- php artisan migrate
- php artisan db:seed
- php artisan migrate:refresh
- php artisan db:seed
npm_test:
stage: test
coverage: &cov '/^Statements\s*:\s*([^%]+)/'
# Cache libraries in between jobs
cache:
key: npn_cache
paths:
- node_modules/
before_script:
- echo NPM INSTALL
- npm i
script:
- echo NPM TEST
- npm test
#before_script:
# - apt-get update -qq
# - apt-get install -qq git
# # Setup SSH deploy keys
# - 'which ssh-agent || ( apt-get install -qq openssh-client )'
# - eval $(ssh-agent -s)
# - ssh-add <(echo "$SSH_PRIVATE_KEY")
# - mkdir -p ~/.ssh
# - '[[ -f /.docker
#deploy_staging:
# type: deploy
# environment:
# name: staging
# script:
# - ssh [email protected] "cd /home/root/helios && git checkout master && git pull bySSH dev && npm install && pm2 reload idpm2 && exit"
# - ssh [email protected] "cd /home/root/helios && git checkout master && git pull bySSH dev && npm install && pm2 reload idpm2 && exit"
# only:
# - master
#npm_build:
# stage: build
# before_script:
# - echo NPM INSTALL
# - npm i
# script:
# - echo NPM RUN PROD
# - npm run prod