Fix release-job schema and central url 15/16215/4
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Tue, 16 Jul 2019 01:06:39 +0000 (18:06 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Tue, 16 Jul 2019 21:49:43 +0000 (14:49 -0700)
Perform "lftools schema verify" command to validate the release files
against schema/release-schema.yaml
Obtain optional maven central URL inside the loop that scans release
files.

Issue: RELENG-2131
Change-Id: I6af1cbb32f25ad33385bac176dc57021d94a5043
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
releasenotes/notes/fix-release-schema-maven-central-0e030293b05561c8.yaml [new file with mode: 0644]
shell/release-job.sh

diff --git a/releasenotes/notes/fix-release-schema-maven-central-0e030293b05561c8.yaml b/releasenotes/notes/fix-release-schema-maven-central-0e030293b05561c8.yaml
new file mode 100644 (file)
index 0000000..7462471
--- /dev/null
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Perform "lftools schema verify" command to validate the release files
+    against schema/release-schema.yaml
+    Obtain optional maven central URL inside the loop that scans release
+    files.
index 96ccffb..e545eca 100644 (file)
@@ -29,11 +29,6 @@ echo "########### Start Script release-job.sh ##################################
 LOGS_SERVER="${LOGS_SERVER:-None}"
 MAVEN_CENTRAL_URL="${MAVEN_CENTRAL_URL:-None}"
 
-#OPTIONAL
-if grep -q "\.maven_central_url" "$release_file"; then
-    MAVEN_CENTRAL_URL="$(niet ".maven_central_url" "$release_file")"
-fi
-
 if [ "${LOGS_SERVER}" == 'None' ]; then
     echo "FAILED: log server not found"
     exit 1
@@ -41,22 +36,25 @@ fi
 
 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
 
+# Fetch the release-schema.yaml
+wget -q https://github.com/lfit/releng-global-jjb/blob/master/schema/release-schema.yaml
+
 release_files=$(git diff HEAD^1 --name-only -- "releases/")
 echo "RELEASE FILES ARE AS FOLLOWS: $release_files"
 
 for release_file in $release_files; do
-    echo "This is the release file: $release_file"
-    echo "--> Verifying $release_file Schema."
-    echo "DUMMY CODE:"
-    #Make sure the schema check catches a missing trailing / on log_dir
-    #lftools schema is written, but not the schema file (yet)
-    echo "lftools schema verify [OPTIONS] $release_file $SCHEMAFILE"
+    echo "--> Verifying $release_file schema."
+    lftools schema verify $release_file release-schema.yaml
+
+    #OPTIONAL
+    if grep -q "\.maven_central_url" "$release_file"; then
+        MAVEN_CENTRAL_URL="$(niet ".maven_central_url" "$release_file")"
+    fi
 
     VERSION="$(niet ".version" "$release_file")"
     PROJECT="$(niet ".project" "$release_file")"
     LOG_DIR="$(niet ".log_dir" "$release_file")"
 
-
     NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/"
     LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
     PATCH_DIR="$(mktemp -d)"