-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
74 lines (68 loc) · 1.88 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
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.34-r3 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
rules:
- when: never
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:[email protected]/Cidaas/cidaas-sdk-php.git HEAD:master -f
only:
- master
when: manual