CI: optimizations (#2885)

* CI: do not publish unnecessary things to s3 and to release registry

* CI: remove the build-linux-release job

* CI: publish less

* CI: workspace = all

* CI: more logs for the pipeline trigger

* CI: chore

* CI: nicer

* CI: new bucket for bins

* CI: no need pushing every master image to product registry

* CI: default variables in image jobs

* CI: optimize the bin build
This commit is contained in:
Denis Pisarev
2021-04-22 10:48:15 +02:00
committed by GitHub
parent c25e79d8c4
commit 683211837b
3 changed files with 66 additions and 92 deletions
+1 -1
View File
@@ -4,4 +4,4 @@ set -e
#shellcheck source=../common/lib.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh"
time cargo test --all --release --verbose --locked --features=runtime-benchmarks
time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks
+14 -8
View File
@@ -1,7 +1,10 @@
#!/bin/bash
set -eu
# API trigger another project's pipeline
echo "Triggering Simnet pipeline."
curl --silent \
-X POST \
-F "token=${CI_JOB_TOKEN}" \
@@ -12,13 +15,14 @@ curl --silent \
-F "variables[IMAGE_TAG]=${IMAGE_TAG}" \
-F "variables[COLLATOR_IMAGE_TAG]=${COLLATOR_IMAGE_TAG}" \
"https://${CI_SERVER_HOST}/api/v4/projects/${DWNSTRM_ID}/trigger/pipeline" | \
tee pipeline
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.
@@ -30,17 +34,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;
elif [[ ${STATUS} =~ ^(failed|canceled|skipped|manual)$ ]]; then
exit 1;
echo "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