CI updates (#8633)

* CI: opt bench jobs; add bench to triggered job

* CI: no need in manual builds; build=publish

* CI: more logs to the trigger job

* CI: DAGs and louts
This commit is contained in:
Denis Pisarev
2021-04-16 21:35:08 +02:00
committed by GitHub
parent c8136bd1df
commit 4dcbac4b58
2 changed files with 29 additions and 37 deletions
+12 -7
View File
@@ -2,6 +2,8 @@
set -eu
# API trigger another project's pipeline
echo "Triggering Simnet pipeline."
curl --silent \
-X POST \
-F "token=${CI_JOB_TOKEN}" \
@@ -14,10 +16,11 @@ curl --silent \
tee pipeline
PIPELINE_ID=$(cat pipeline | jq ".id")
echo "\nWaiting on ${PIPELINE_ID} status..."
PIPELINE_URL=$(cat pipeline | jq ".web_url")
echo
echo "Simnet pipeline ${PIPELINE_URL} was successfully triggered."
echo "Now we're polling it to obtain the distinguished status."
# This part polls for the triggered pipeline status, the native
# `trigger` job does not return this status via API.
# This is a workaround for a Gitlab bug, waits here until
# https://gitlab.com/gitlab-org/gitlab/-/issues/326137 gets fixed.
# The timeout is 360 curls with 8 sec interval, roughly an hour.
@@ -29,17 +32,19 @@ function get_status() {
jq --raw-output ".status";
}
echo "Waiting on ${PIPELINE_ID} status..."
for i in $(seq 1 360); do
STATUS=$(get_status);
echo "Triggered pipeline status is ${STATUS}";
if [[ ${STATUS} =~ ^(pending|running|created)$ ]]; then
echo "Busy...";
echo "${STATUS}"...";
elif [[ ${STATUS} =~ ^(failed|canceled|skipped|manual)$ ]]; then
exit 1;
echo "Oh noes! Something's broken in: ${PIPELINE_URL}"; exit 1;
elif [[ ${STATUS} =~ ^(success)$ ]]; then
exit 0;
echo "Look how green it is: ${PIPELINE_URL}"; exit 0;
else
exit 1;
echo "Something else has happened in ${PIPELINE_URL}"; exit 1;
fi
sleep 8;
done