-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
30 lines (28 loc) · 1.03 KB
/
.gitlab-ci.yml
File metadata and controls
30 lines (28 loc) · 1.03 KB
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
stages:
- trigger-deploy
trigger-deploy:
image: alpine
stage: trigger-deploy
only:
- github-release
script:
- set -e
- echo "Triggering Maven Deploy Repository IGRP Framework Auth Backend Monorepo..."
- apk add --no-cache curl
- '[ -z "$GITLAB_DEPLOY_TOKEN" ] && echo "Missing GITLAB_DEPLOY_TOKEN" && exit 1'
- '[ -z "$GITLAB_DEPLOY_PROJECT_ID" ] && echo "Missing GITLAB_DEPLOY_PROJECT_ID" && exit 1'
- |
RESPONSE=$(curl -s -w "%{http_code}" -o /tmp/response.txt \
-X POST \
-F "token=${GITLAB_DEPLOY_TOKEN}" \
-F "ref=deploy" \
-F "variables[LIBRARY_NAME]=${CI_PROJECT_NAME}" \
-F "variables[GROUP_PATH]=${CI_GROUP_PATH}" \
"https://git.nosi.cv/api/v4/projects/${GITLAB_DEPLOY_PROJECT_ID}/trigger/pipeline")
if [ "$RESPONSE" -ne 201 ]; then
echo "❌ Pipeline trigger failed. HTTP status: $RESPONSE"
cat /tmp/response.txt
exit 1
else
echo "✅ Successfully triggered deploy pipeline for ${CI_PROJECT_NAME}"
fi