From 97b2c167fe54298814d5985f705ac767fd1912be Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Wed, 28 Aug 2019 11:39:00 -0400 Subject: [PATCH] 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 --- releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml | 8 ++++++++ shell/release-job.sh | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml 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 } -- 2.16.6