-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
34 lines (32 loc) · 1.27 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
include:
# This remote project centralize our CI "golden path" https://docs.gitlab.com/ee/ci/yaml/#includefile
remote: 'https://gitlab.com/drupalspoons/composer-plugin/-/raw/master/templates/.gitlab-ci.yml'
# Override phpcs config
phpcs:
stage: test
script:
- cp -u $WEB_ROOT/core/phpcs.xml.dist $WEB_ROOT/modules/custom
- composer phpcs -- --report-junit=junit.xml --report-full --report-summary
allow_failure: false
artifacts:
expose_as: junit
expire_in: 6 mos
paths:
- junit.xml
reports:
junit: junit.xml
# Sync with Github
sync-with-github:
before_script:
- git config --global user.name "${GITHUB_USER_NAME}"
- git config --global user.email "${GITHUB_USER_EMAIL}"
- git config --global --add safe.directory /builds/project/${GITHUB_REPOSITORY_NAME}
script:
- echo Syncing Code from GITLAB to GITHUB.
- git remote add github "${GITHUB_REMOTE_REPOSITORY_URL}"
- git checkout 1.x-dev
- git pull origin 1.x-dev
- git status
- git push https://"${GITHUB_ACCESS_TOKEN}"@github.com/"${GITHUB_USER_NAME}"/"${GITHUB_REPOSITORY_NAME}".git
rules:
- if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "1.x-dev")