Skip to content

Commit 8181c09

Browse files
committed
Merge branch 'postlogs'
2 parents 778b1a0 + d88cced commit 8181c09

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ do
5050
done
5151

5252
echo "Pipeline finished with status ${ci_status}"
53+
54+
echo "Fetching all GitLab pipeline jobs involved"
55+
ci_jobs=$(curl --header "PRIVATE-TOKEN: $GITLAB_PASSWORD" --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}/jobs" | jq -r '.[] | { id, name, stage }')
56+
echo "Posting output from all GitLab pipeline jobs"
57+
for JOB_ID in $(echo $ci_jobs | jq -r .id); do
58+
echo "##[group]Stage $( echo $ci_jobs | jq -r "select(.id=="$JOB_ID") | .stage" ) / Job $( echo $ci_jobs | jq -r "select(.id=="$JOB_ID") | .name" )"
59+
curl --header "PRIVATE-TOKEN: $GITLAB_PASSWORD" --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/jobs/${JOB_ID}/trace"
60+
echo "##[endgroup]"
61+
done
62+
echo "Debug problems by unfolding stages/jobs above"
5363

5464
if [ "$ci_status" = "success" ]
5565
then

0 commit comments

Comments
 (0)