Skip to content

Commit

Permalink
Make everything silent and echo status during poll
Browse files Browse the repository at this point in the history
  • Loading branch information
SvanBoxel authored Sep 2, 2019
1 parent 349a0a7 commit a9c2a90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9c2a90

Please sign in to comment.