mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user