From: Aric Gardner Date: Wed, 28 Aug 2019 15:39:00 +0000 (-0400) Subject: Verify both repos before attempting release X-Git-Tag: v0.42.1~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F16719%2F3;p=releng%2Fglobal-jjb.git Verify both repos before attempting release We have run into a case where the repo on ODL was good, and the repo on nexus was failed. Cover this case by running the loop twice. Signed-off-by: Aric Gardner Change-Id: I995a34918481db9e41d5486c06995f57100c1199 --- diff --git a/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml b/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml new file mode 100644 index 00000000..1c127fb9 --- /dev/null +++ b/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Verify both repos before attempting release. + We have run into a case where the repo on ODL + nexus was good, and the repo on Sonatype nexus + was missing. Cover this case by running the verify + loop over each repo before attempting release. diff --git a/shell/release-job.sh b/shell/release-job.sh index 6510ce5b..3a36a579 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -75,11 +75,17 @@ nexus_release(){ lftools nexus release -v --server https://"$NEXUS_URL" "$STAGING_REPO" echo "Merge will run" echo "lftools nexus release --server https://$NEXUS_URL $STAGING_REPO" - if [[ "$JOB_NAME" =~ "merge" ]]; then + done + #Run the loop twice, to catch errors on either nexus repo + + if [[ "$JOB_NAME" =~ "merge" ]]; then + for staging_url in $(zcat "$PATCH_DIR"/staging-repo.txt.gz | awk -e '{print $2}'); do + NEXUS_URL=$(echo "$staging_url" | sed -e 's|^[^/]*//||' -e 's|/.*$||') + STAGING_REPO=${staging_url#*repositories/} echo "Promoting $STAGING_REPO on $NEXUS_URL." lftools nexus release --server https://"$NEXUS_URL" "$STAGING_REPO" - fi - done + done + fi }