Fix use-release-file varaible 73/16673/3
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Mon, 26 Aug 2019 20:59:33 +0000 (13:59 -0700)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 27 Aug 2019 02:51:22 +0000 (08:21 +0530)
Rename "RELEASE_FILE" parameter to "USE_RELEASE_FILE" in
release-jobs. This will match the actual varaible default value
better and will not collide with the local "release_file" in
the script.

Fix "USE_RELEASE_FILE" if statement. We are now using a bool
instead of a string.

Changing the if statements to evaluate bools.

Change-Id: I9909a16487fabacc0261f6489ac81a00cbf0f965
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
docs/jjb/lf-release-jobs.rst
jjb/lf-macros.yaml
releasenotes/notes/fix-use-release-file-var-a5f3ea05b58ec194.yaml [new file with mode: 0644]
shell/release-job.sh

index f07c4e5..a2cfd95 100644 (file)
@@ -9,14 +9,14 @@ Jenkins will pick this up and sign the ref extrapolated by log_dir and promote t
 
 Maven release jobs can also trigger via "Build with parameters" negating the need for a release file.
 The parameters will need to be filled out in the same was as a release file's would, excepting the speacial
-RELEASE_FILE parameter which will need to be set to False to inform the job that it should not expect a release file.
+USE_RELEASE_FILE parameter which will need to be set to False to inform the job that it should not expect a release file.
 The Special Parameters are as follows:
 
 GERRIT_BRANCH = master
 VERSION = 1.0.0
 LOG_DIR = example-project-maven-stage-master/17/
 DISTRIBUTION_TYPE = maven
-RELEASE_FILE = False
+USE_RELEASE_FILE = false
 
 .. note::
 
index b01887c..15f008a 100644 (file)
           default: ""
           description: "Set to maven for build with parametes"
       - bool:
-          name: RELEASE_FILE
+          name: USE_RELEASE_FILE
           default: "{use-release-file}"
           description: "Set to False for job built with parameters"
 
diff --git a/releasenotes/notes/fix-use-release-file-var-a5f3ea05b58ec194.yaml b/releasenotes/notes/fix-use-release-file-var-a5f3ea05b58ec194.yaml
new file mode 100644 (file)
index 0000000..6303ced
--- /dev/null
@@ -0,0 +1,9 @@
+---
+fixes:
+  - |
+    Rename "RELEASE_FILE" parameter to "USE_RELEASE_FILE" in release-jobs.
+    This will match the actual varaible default value better and will not
+    collide with the local "release_file" in the script.
+  - |
+    Fix "USE_RELEASE_FILE" if statement. We are now using a bool instead of
+    a string. Changing the if statements to evaluate bools.
index 0ada461..6510ce5 100644 (file)
@@ -151,8 +151,7 @@ if [ "${LOGS_SERVER}" == 'None' ]; then
     exit 1
 fi
 
-RELEASE_FILE="${RELEASE_FILE:-True}"
-if [[ "$RELEASE_FILE" == "True" ]]; then
+if $USE_RELEASE_FILE ; then
 
   release_files=$(git diff-tree --no-commit-id -r "$GERRIT_PATCHSET_REVISION" --name-only -- "releases/" ".releases/")
   if (( $(grep -c . <<<"$release_files") > 1 )); then
@@ -165,7 +164,7 @@ if [[ "$RELEASE_FILE" == "True" ]]; then
   fi
 
 else
-  echo "This is job is built with parameters, no release file needed"
+  echo "This job is built with parameters, no release file needed. Continuing..."
   release_file="None"
 fi
 
@@ -211,7 +210,7 @@ echo "DISTRIBUTION_TYPE: $DISTRIBUTION_TYPE"
 if [[ "$DISTRIBUTION_TYPE" == "maven" ]]; then
   wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/release-schema.yaml
   RELEASE_SCHEMA="release-schema.yaml"
-  if [[ "$RELEASE_FILE" == "True" ]]; then
+  if $USE_RELEASE_FILE ; then
     verify_schema
   fi
   maven_release_file