-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
97 lines (87 loc) · 2.76 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
stages:
- lint
- codestyle
- tarballs
- trigger
## Stage lint
# PHP lint
create_php_lint_rapport:
image: registry.fusiondirectory.org/fusiondirectory/fd/phpcodesniffer-cli:buster
stage: lint
only:
- branches
script:
- find . -type f -name '*.php' -o -name '*.inc' -print0 | xargs -0 -n1 php -l
## Stage codestyle
# PHP codesniffer
create_php_code_sniffer_rapport:
image: registry.fusiondirectory.org/fusiondirectory/fd/phpcodesniffer-cli:buster
stage: codestyle
only:
- branches
script:
- test -d ../dev-tools/ && rm -Rf ../dev-tools/
- git clone --depth 1 https://gitlab.fusiondirectory.org/fusiondirectory/dev-tools.git ../dev-tools
- find . -type f -name '*.php' -o -name '*.inc' > ./filelist
- /root/.composer/vendor/bin/phpcs --standard=../dev-tools/php-codesniffer-rules/FDStandard/ruleset.xml --file-list=./filelist
- /root/.composer/vendor/bin/phpcs --config-set installed_paths /PHPCompatibility,/PHPCSUtils
- /root/.composer/vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion $PHP_COMPATIBILITY --file-list=./filelist
# phpstan
create_phpstan_rapport:
image: registry.fusiondirectory.org/fusiondirectory/fd/phpstan-cli:buster
stage: codestyle
only:
- branches
script:
- test -d ../dev-tools/ && rm -Rf ../dev-tools/
- git clone --depth 1 https://gitlab.fusiondirectory.org/fusiondirectory/dev-tools.git ../dev-tools
- apt install libphp-phpmailer
- cp ../dev-tools/phpstan/fusiondirectory-integrator/*.neon .
- /root/.composer/vendor/bin/phpstan analyse -c phpstan.neon
build-tarballs:
stage: tarballs
only:
- dev
script:
- mkdir ../fusiondirectory-integrator-$VERSION/
- mv ./* ../fusiondirectory-integrator-$VERSION/
- mv ../fusiondirectory-integrator-$VERSION/ ./
- tar -cvzf fusiondirectory-integrator-$VERSION.tar.gz *
artifacts:
paths:
- fusiondirectory-integrator-$VERSION.tar.gz
expire_in: 30d
build-release:
stage: tarballs
only:
- tags
script:
- VERSION=$(grep '%' Changelog.md | head -n1 | cut -d ' ' -f4 | tr -d '"')
- mkdir ../fusiondirectory-integrator-$VERSION/
- mv ./* ../fusiondirectory-integrator-$VERSION/
- mv ../fusiondirectory-integrator-$VERSION/ ./
- tar -cvzf fusiondirectory-integrator-$VERSION.tar.gz *
artifacts:
paths:
- ./*.tar.gz
trigger-ci-debian-bullseye:
stage: trigger
only:
- dev
trigger:
project: debian/bullseye-fusiondirectory-integrator-dev
branch: "main"
trigger-ci-ubuntu-focal:
stage: trigger
only:
- dev
trigger:
project: ubuntu/focal-fusiondirectory-integrator-dev
branch: "main"
trigger-ci-centos-7:
stage: trigger
only:
- dev
trigger:
project: centos/centos7-fusiondirectory-integrator-dev
branch: "main"