-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
46 lines (42 loc) · 1.31 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
---
stages:
- publish
image: docker.team23.de/docker/php:7.4
publish_branch:
stage: publish
script:
- url="https://git.team23.de/api/v4/projects/$CI_PROJECT_ID/packages/composer"
- curl --data branch=${CI_COMMIT_REF_NAME} --data "token=$CI_JOB_TOKEN" $url
only:
refs:
- main
publish_tag:
stage: publish
script:
- url="https://git.team23.de/api/v4/projects/$CI_PROJECT_ID/packages/composer"
- curl --data tag=${CI_COMMIT_REF_NAME} --data "token=$CI_JOB_TOKEN" $url
only:
refs:
- /^[0-9]+(?:.[0-9]+)+$/
- /^[0-9]+(?:.[0-9]+)+(?:[-]rc[0-9]+)$/
publish_ter:
stage: publish
image: composer:2
only:
refs:
- /^[0-9]+(?:.[0-9]+)+$/
when: manual
before_script:
- composer global require typo3/tailor
- rm .gitlab-ci.yml
script:
- >
if [ -n "$CI_COMMIT_TAG" ] && [ -n "$TYPO3_API_TOKEN" ] && [ -n "$TYPO3_EXTENSION_KEY" ]; then
echo -e "Preparing upload of release ${CI_COMMIT_TAG} to TER\n"
# Cleanup before we upload
git reset --hard HEAD && git clean -fx
# Upload
TAG_MESSAGE=`git tag -n10 -l $CI_COMMIT_TAG | sed 's/^[0-9.]*[ ]*//g'`
echo "Uploading release ${CI_COMMIT_TAG} to TER"
/tmp/vendor/bin/tailor ter:publish --comment "$TAG_MESSAGE" "$CI_COMMIT_TAG" "$TYPO3_EXTENSION_KEY"
fi;