-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
79 lines (72 loc) · 2.09 KB
/
.gitlab-ci.yml
File metadata and controls
79 lines (72 loc) · 2.09 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
include:
- project: "widas/codequality"
ref: master
file: "ci_templates/php8.gitlab-ci.yml"
stages:
- test
- badges
- deploy
- release
- publish
codecoverage:
image: php:fpm-alpine
before_script:
- apk add --no-cache tar=1.35-r2 git zip unzip $PHPIZE_DEPS linux-headers
- pecl install xdebug
- docker-php-ext-enable xdebug
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
script:
- XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" > coverage_report.txt
coverage: '/Lines:\s+(\d+.\d+)%/'
artifacts:
paths:
- coverage_report.txt
create_codequality_badges:
rules:
- when: never
pages:
before_script:
- mkdir public
release:
image: docker-registry.widas.de:5050/dockerregistry/common/semantic-release:v1.0.5
stage: release
script:
- semantic-release
only:
- master
- /^hotfix.*$/
- /^release-v.*$/
github_sync:
stage: publish
image: bitnami/git
script:
- git config --global --add safe.directory $PWD
- git config --global user.name $GITLAB_USER_NAME
- git config --global user.email $GITLAB_USER_EMAIL
- git checkout master
- git remote -v >> temp
- if grep -q github temp;then echo 'remote github already exists';else git remote add github https://github.com/Cidaas/cidaas-sdk-php.git;fi
- |
OBJECTS="Dockerfile .gitlab-ci.yml scripts temp docker docker-compose.yml run-php-docker.sh Jenkinsfile public codeclimate.html gl-code-quality-report.json"
ISFILECHANGED=false
for FILE in $OBJECTS
do
if grep -Fxq $FILE .gitignore;
then echo "do nothing";
else echo "$FILE" >> .gitignore;
ISFILECHANGED=true
fi
done
if $ISFILECHANGED;
then
git add .gitignore;
git commit -m "fix(): cleanup";
git rm -r --cached .;
git add .;
git commit -m "fix(): gitignore update"
fi
- git push https://$USER:$PAT@github.com/Cidaas/cidaas-sdk-php.git HEAD:master -f
only:
- master
when: manual