From a9c2a90307749df2ac8b063ffd95715ebd53907f Mon Sep 17 00:00:00 2001 From: Sebass van Boxel Date: Mon, 2 Sep 2019 11:38:58 +0200 Subject: [PATCH] Make everything silent and echo status during poll --- entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index fd8e53b..4d841d6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,18 +29,19 @@ ci_status="pending" until [[ "$ci_status" != "pending" && "$ci_status" != "running" ]] do sleep $POLL_TIMEOUT - ci_output=$(curl --header "PRIVATE-TOKEN: $GITLAB_PASSWORD" "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}") + ci_output=$(curl --header "PRIVATE-TOKEN: $GITLAB_PASSWORD" --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}") ci_status=$(jq -n "$ci_output" | jq -r .status) ci_web_url=$(jq -n "$ci_output" | jq -r .web_url) + echo "Current pipeline status: ${ci_status}" if [ "$ci_status" = "running" ] then - echo "Checking GitLab pipeline status..." + echo "Checking pipeline status..." curl -d '{"state":"pending", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" > /dev/null fi done -echo "GitLab pipeline finished with status ${ci_status}" +echo "Pipeline finished with status ${ci_status}" if [ "$ci_status" = "success" ] then