Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### echo envvars
- #set
- #set -x
- RES=0
- rm -rf archive archive.zip
- IFS="$IFS," ; for TJN in $TRIGGERED_JOB_NAMES ; do
- # Assume each sub-job name is all dash-separated where this was escaped into underscores
- # Note that dashes must not be part of shell var names, and that apparently MultiJob Phase behaves differently from simple Trigger build on other project
- TAG="`echo "$TJN" | tr '-' '_' | tr '[a-z]' '[A-Z]'`"
- JOB="`echo "$TJN" | tr '_' '-'`"
- #VAR="TRIGGERED_BUILD_NUMBER_$TAG"
- VAR="${TAG}_BUILD_NUMBER"
- NUM="`eval echo '\$'$VAR`"
- echo "=== Getting XML artifacts from job '$JOB' build '$NUM'"
- rm -rf archive archive.zip
- wget --no-check-certificate "${JENKINS_URL}/job/${JOB}/${NUM}/artifact/"'*zip*/archive.zip' \
- || { echo "SKIP: no artifacts downloaded for job '$JOB' build '$NUM'" >&2 ; continue ; }
- unzip archive.zip \
- || { echo "ERROR: could not unpack artifacts archive downloaded for job '$JOB' build '$NUM'" >&2 ; RES=42 ; continue ; }
- mv -f archive/*.xml . \
- && echo "===== Remainder (if any):" && find archive -ls \
- || { echo "SKIP: no XML artifacts were archived by job '$JOB' build '$NUM'" >&2 ; continue ; }
- done
- rm -rf archive archive.zip
- [ "$RES" = 0 ] || echo "WARNING : At least one artifact-archive operation above ended badly" >&2
- exit $RES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement