From: Jessica Wagantall Date: Tue, 16 Jul 2019 01:06:39 +0000 (-0700) Subject: Fix release-job schema and central url X-Git-Tag: v0.40.0~12 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=1c00d29b81fd8ae07206987f8994ac36eb0e6b1c;p=releng%2Fglobal-jjb.git Fix release-job schema and central url 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 --- 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 index 00000000..7462471e --- /dev/null +++ b/releasenotes/notes/fix-release-schema-maven-central-0e030293b05561c8.yaml @@ -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. diff --git a/shell/release-job.sh b/shell/release-job.sh index 96ccffbf..e545ecac 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -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)"