Verify both repos before attempting release 19/16719/3
authorAric Gardner <agardner@linuxfoundation.org>
Wed, 28 Aug 2019 15:39:00 +0000 (11:39 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Wed, 28 Aug 2019 16:11:55 +0000 (12:11 -0400)
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 <agardner@linuxfoundation.org>
Change-Id: I995a34918481db9e41d5486c06995f57100c1199

releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml [new file with mode: 0644]
shell/release-job.sh

diff --git a/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml b/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml
new file mode 100644 (file)
index 0000000..1c127fb
--- /dev/null
@@ -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.
index 6510ce5..3a36a57 100644 (file)
@@ -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
 }