forked from jobtome-labs/ci-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentry.yml
69 lines (56 loc) · 1.59 KB
/
sentry.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
.sentry:
image: linuxbandit/sentry-cli-bash:v1.1.0
only:
- /^v.+$/i
- master
- merge_requests
allow_failure: true
when: on_success
script:
- &check-set-variables |
# CHECK VARIABLES PHASE
for var in "SENTRY_AUTH_TOKEN" "SENTRY_URL" "SENTRY_ORG" "SENTRY_PROJECT"; do
if [ -z "${!var}" ]; then
echo "Missing '${var}' variable!"
exit 1
fi
done
ENVIRONMENT="production"
if [ -z "${CI_COMMIT_TAG}" ]; then
CI_COMMIT_TAG=$(git describe --tags --always)
ENVIRONMENT="quality"
fi
sentry-cli info
sentry:release:set:
extends: .sentry
stage: build
script:
- *check-set-variables
- |
#SET NEW RELEASE
sentry-cli releases new "${CI_COMMIT_TAG}"
if [ -n "${FEAT_SENTRY_SETCOMMITS}" ]; then
echo
echo "-> [INFO] variable 'FEAT_SENTRY_SETCOMMITS' for experimental feature enabled!"
echo
sentry-cli releases set-commits "${CI_COMMIT_TAG}" --auto
fi
echo "Sentry release set to ${CI_COMMIT_TAG}!"
sentry:release:finalize:
extends: .sentry
stage: deploy
script:
- *check-set-variables
- |
#FINALISE RELEASE
sentry-cli releases finalize "${CI_COMMIT_TAG}"
echo "Sentry release finalized to ${CI_COMMIT_TAG}!"
sentry:notify:
extends: .sentry
stage: notify
script:
- *check-set-variables
- |
#SET NEW DEPLOY
sentry-cli releases deploys "${CI_COMMIT_TAG}" new -e "${ENVIRONMENT}"
echo "Sentry was notified that release ${CI_COMMIT_TAG} was set for ${ENVIRONMENT}!"