Verified Commit b2af0afc authored by Hans-Nikolai Viessmann's avatar Hans-Nikolai Viessmann
Browse files

use shallow clone; fail on missing artifacts

parent 0219a622
......@@ -2,8 +2,7 @@ image: sacbuild/archlinux:latest
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
GIT_FETCH_EXTRA_FLAGS: --no-tags
GIT_DEPTH: "1" # limit clone to latest commit
stages:
- store
......@@ -18,7 +17,10 @@ store-pkgs:
echo "Missing project details!!!"
exit 10;
fi
- ./get-assets.sh -v -a "${TOKEN}" -u "https://gitlab.sac-home.org" -p "${PROJECTID}" -c "${PIPEID}"
- if ! ./get-assets.sh -v -a "${TOKEN}" -u "https://gitlab.sac-home.org" -p "${PROJECTID}" -c "${PIPEID}"; then
echo "Failure to retrieve artifacts!"
exit 10;
fi
- cd packages; cp -r pkgs/weekly .; rm -r pkgs; cd ..
- ./place-latest.sh
- git add latest/ packages/
......
......@@ -9,7 +9,7 @@
#
# Note: makes use of external tools `curl`, `jq`, `unzip`
declare -g APIKEY GLURL PRID PIPEID VERB=false
declare -g APIKEY GLURL PRID PIPEID RETURN=0 VERB=false
usage() { echo "Usage: $0 [-v...] -a <api key> -u <gitlab url> -p <project id> -c <pipeline id>" >&2; exit 0; }
msginfo() { ${VERB} && echo "-- $*" >&2; }
......@@ -66,7 +66,7 @@ while IFS=' ' read -r jobid jobname; do
fi
else
msgerror "Job \`$jobname' has no artifacts!"
#exit 2
RETURN=2
fi
done <<< "$(curl -s --header "PRIVATE-TOKEN: ${APIKEY}" "${GLURL}/api/v4/projects/${PRID}/pipelines/${PIPEID}/jobs" | \
jq -r '.[] | ((.id | tostring) + " " + .name)')"
......@@ -80,4 +80,4 @@ for archive in artifact-*.zip; do
rm "$archive"
done
exit 0
exit $RETURN
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment