diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b939313..b99a173 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -178,6 +178,16 @@ deploy-staging: # Restart staging service - sudo systemctl restart cve-backend-staging || sudo systemctl start cve-backend-staging || true - echo "Staging deploy complete." + after_script: + - | + ISSUES=$(git log --format=%B -1 | grep -oP '#\d+' | tr -d '#' | sort -u) + for ISSUE in $ISSUES; do + curl --silent --request POST \ + --header "PRIVATE-TOKEN: ${GITLAB_PAT}" \ + "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/issues/${ISSUE}/notes" \ + --data-urlencode "body=✅ Deployed to **staging** in pipeline [#${CI_PIPELINE_ID}](${CI_PIPELINE_URL}) (commit \`${CI_COMMIT_SHORT_SHA}\`)" \ + > /dev/null 2>&1 || true + done needs: - build-frontend - test-backend @@ -221,6 +231,16 @@ deploy-production: - ssh ${PROD_USER}@${PROD_HOST} "test -f /etc/systemd/system/cve-backend.service" || scp ${CI_PROJECT_DIR}/deploy/cve-backend-production.service ${PROD_USER}@${PROD_HOST}:/etc/systemd/system/cve-backend.service - ssh ${PROD_USER}@${PROD_HOST} "systemctl daemon-reload && systemctl enable cve-backend && systemctl restart cve-backend" - echo "Production deploy complete." + after_script: + - | + ISSUES=$(git log --format=%B -1 | grep -oP '#\d+' | tr -d '#' | sort -u) + for ISSUE in $ISSUES; do + curl --silent --request POST \ + --header "PRIVATE-TOKEN: ${GITLAB_PAT}" \ + "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/issues/${ISSUE}/notes" \ + --data-urlencode "body=🚀 Deployed to **production** in pipeline [#${CI_PIPELINE_ID}](${CI_PIPELINE_URL}) (commit \`${CI_COMMIT_SHORT_SHA}\`)" \ + > /dev/null 2>&1 || true + done needs: - build-frontend - test-backend