-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
85 lines (80 loc) · 2.16 KB
/
.gitlab-ci.yml
File metadata and controls
85 lines (80 loc) · 2.16 KB
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
stages:
- build
- test
composer:
stage: build
image: internalprojectmanger/ipm-docker:1.0
tags:
- docker
cache:
key: ${CI_COMMIT_REF_SLUG}-composer
paths:
- vendor/
script:
- composer install --dev --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env
yarn:
stage: build
image: internalprojectmanger/ipm-docker:1.0
tags:
- docker
cache:
key: ${CI_COMMIT_REF_SLUG}-yarn
paths:
- node_modules/
script:
- yarn install
- yarn run prod
artifacts:
expire_in: 1 month
paths:
- node_modules/
- public/css/
- public/js/
codestyle:
stage: test
image: internalprojectmanger/ipm-docker:1.0
tags:
- docker
dependencies:
- composer
script:
- php vendor/bin/phpcs --error-severity=1 --warning-severity=8 --standard=PSR2 --extensions=php --ignore=app/Support/helpers.php app
allow_failure: true
phpunit:
stage: test
image: internalprojectmanger/ipm-docker:1.0
tags:
- docker
dependencies:
- composer
script:
- php vendor/bin/phpunit --coverage-text --colors=never
#staging:
# stage: deploy
# variables:
# DC_PROJ: ${DC_NAME}_develop
# DC_NAME: ipm
# DC_FILE: /usr/share/jwa-dockers/sites/${DC_NAME}_develop/docker-compose.yml
# only:
# - master
# - develop
# tags:
# - develop
# script:
# - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME git checkout $CI_BUILD_REF_NAME
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME git pull origin $CI_BUILD_REF_NAME
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME composer install
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME php artisan migrate:fresh --seed
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME php artisan config:cache
# - docker-compose -p $DC_PROJ -f $DC_FILE exec -T $DC_NAME yarn install --production
# environment:
# name: staging
# url: https://dev.itsaprojectmanager.tk