-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
91 lines (71 loc) · 1.58 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
include:
- project: 'continuous-integration/gitlab'
ref: master
file:
- '/docker/base.yml'
- '/php/composer.yml'
- '/php/php-cs-fixer.yml'
- '/php/phpcpd.yml'
- '/php/phpstan.yml'
- '/php/phpunit.yml'
- '/php/security-checker.yml'
variables:
PHP_IMAGE: containers.textinfo.nl/php/docker:8.0-ci
.ci-rules:
rules:
- if: '$CI_SERVER_HOST == "gitlab.textinfo.nl" && $CI_COMMIT_BRANCH == "master"'
when: on_success
allow_failure: false
- if: '$CI_SERVER_HOST == "gitlab.textinfo.nl" && $CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
allow_failure: false
stages:
- build
- test
- security
- analysis
- publish
composer:
extends:
- .composer-dev
- .ci-rules
stage: build
phpunit:
extends:
- .phpunit
- .ci-rules
stage: test
security-checker:
extends:
- .security-checker
- .ci-rules
stage: security
phpcpd:
extends:
- .phpcpd
- .ci-rules
stage: analysis
phpstan:
extends:
- .phpstan
- .ci-rules
stage: analysis
php-cs-fixer:
extends:
- .php-cs-fixer
- .ci-rules
stage: analysis
docker image:
variables:
DOCKER_IMAGE: "docker:git"
extends:
- .docker-base
stage: publish
rules:
- if: '$CI_SERVER_HOST == "gitlab.textinfo.nl" && $CI_COMMIT_BRANCH == "master"'
when: on_success
allow_failure: false
script:
- git rev-parse --short HEAD > ./CHECKSUM
- docker build --pull --tag "$CI_REGISTRY_IMAGE:$(cat ./VERSION)" --rm ./
- docker push "$CI_REGISTRY_IMAGE:$(cat ./VERSION)"