-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
84 lines (79 loc) · 2.11 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
stages:
- test
- release
include:
- project: 'muensmedia-docker/gitlab-ci-recipes'
ref: master
file: '/compression/.pack-zip-archive.yml'
- project: 'muensmedia-docker/gitlab-ci-recipes'
ref: master
file: '/deployment/.rsync.yml'
"Create zip archive":
extends: .pack-zip
stage: test
variables:
ZIP_ARCHIVE_PATH: '../.release/'
ZIP_ARCHIVE_NAME: er24_rechtstexte-${CI_COMMIT_TAG}
ZIP_DESTINATION: ${ZIP_ARCHIVE_PATH}er24_rechtstexte-${CI_COMMIT_TAG}${ZIP_FILE_EXTENSION}
before_script:
- unlink .editorconfig
- unlink .gitlab-ci.yml
after_script:
- mkdir .release
- cp ${ZIP_DESTINATION} .release/
- cp ${ZIP_DESTINATION} .release/er24_rechtstexte.zip
artifacts:
paths:
- .release
only:
- tags
# upload new version to download server
deploy:rsync:
extends: .deploy-rsync
stage: release
needs:
- "Create zip archive"
variables:
PATH_TO_RSYNCIGNORE: ''
FOLDER_TO_SYNC: '.release/'
RSYNC_OPTIONS: ''
before_script:
- ls -la ${FOLDER_TO_SYNC}
only:
- tags
"Publish new version to TER":
stage: release
needs:
- "Create zip archive"
image: composer:2
before_script:
- composer global require typo3/tailor
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"
# 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" --artefact=.release/er24_rechtstexte.zip "$CI_COMMIT_TAG" "$TYPO3_EXTENSION_KEY"
fi;
only:
- tags
#"Trigger tests for tags":
# stage: test
# trigger:
# project: erecht24/rechtstexte-plugin/typo3-rechtstexte-testing
# strategy: depend
# variables:
# COMPOSER_VERSION: $CI_COMMIT_REF_NAME
# only:
# - tags
#
#"Trigger tests for branches":
# extends: "Trigger tests for tags"
# variables:
# COMPOSER_VERSION: dev-$CI_COMMIT_REF_NAME
# only:
# - branches
# except:
# - tags