-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
.gitlab-ci.yml
115 lines (104 loc) · 3.82 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
102
103
104
105
106
107
108
109
110
111
112
113
114
stages:
- lint
- codestyle
- transifex
- 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 --ignore=class_sieve.inc --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
- test -d ../fusiondirectory/ && rm -Rf ../fusiondirectory/
- git clone --depth 1 https://gitlab.fusiondirectory.org/fusiondirectory/fd.git ../fusiondirectory
- composer global require phpstan/phpstan=0.12.94
- cp ../dev-tools/phpstan/fusiondirectory/1.5/*.neon .
- /root/.composer/vendor/bin/phpstan analyse -c phpstan-plugins.neon
# fusiondirectory-update-locale
fusiondirectory-update-locale:
image: registry.fusiondirectory.org/fusiondirectory/fd/transifex-cli:buster
stage: transifex
only:
- dev
script:
- test -d ../dev-tools/ && rm -Rf ../dev-tools/
- git clone --depth 1 https://gitlab.fusiondirectory.org/fusiondirectory/dev-tools.git ../dev-tools
- ../dev-tools/locale-scripts/fusiondirectory-update-locale-plugins
# Update transifex
update-transifex:
image: registry.fusiondirectory.org/fusiondirectory/fd/transifex-cli:buster
stage: transifex
only:
- dev
script:
- test -d ../dev-tools/ && rm -Rf ../dev-tools/
- git clone --depth 1 https://gitlab.fusiondirectory.org/fusiondirectory/dev-tools.git ../dev-tools
- echo $'[https://www.transifex.com]\nrest_hostname = '"$TRANSIFEX_REST_HOSTNAME"$'\nusername = '"$TRANSIFEX_USER"$'\ntoken = '"$TRANSIFEX_TOKEN"$'\n' > ~/.transifexrc
- tx pull -a -f
- ../dev-tools/locale-scripts/fusiondirectory-update-locale-plugins
- tx push -s -t --skip
build-tarballs:
stage: tarballs
only:
- dev
script:
- mkdir ../fusiondirectory-plugins-$VERSION/
- mv ./* ../fusiondirectory-plugins-$VERSION/
- mv ../fusiondirectory-plugins-$VERSION/ ./
- tar -cvzf fusiondirectory-plugins-$VERSION.tar.gz *
artifacts:
paths:
- fusiondirectory-plugins-$VERSION.tar.gz
expire_in: 30d
build-release:
stage: tarballs
only:
- tags
script:
- VERSION=$(grep '%' Changelog.md | head -n1 | cut -d ' ' -f3 | tr -d '"')
- mkdir ../fusiondirectory-$VERSION/
- mv ./* ../fusiondirectory-$VERSION/
- mv ../fusiondirectory-$VERSION/ ./
- tar -cvzf fusiondirectory-$VERSION.tar.gz *
artifacts:
paths:
- ./*.tar.gz
trigger-ci-debian-buster:
stage: trigger
only:
- dev
variables:
GROUP: "$GROUP"
BRANCH_CORE: "$CI_COMMIT_REF_NAME"
BRANCH_PLUGIN: "$CI_COMMIT_REF_NAME"
BRANCH_BUILD_DEBIAN_BUSTER: "$BRANCH_BUILD_DEBIAN_BUSTER"
trigger:
project: debian/buster-fusiondirectory-dev
branch: "$BRANCH_BUILD_DEBIAN_BUSTER"