Merge "xci: Enable Functest Healthcheck for Kubernetes scenarios"
[releng.git] / jjb / releng / generate-job-list.sh
index b32a514..4bf8974 100755 (executable)
@@ -1,8 +1,4 @@
-#! /bin/bash
-set -o errexit
-set -o nounset
-set -o pipefail
-
+#!/bin/bash
 # SPDX-license-identifier: Apache-2.0
 ##############################################################################
 # Copyright (c) 2016 Linux Foundation and others.
@@ -12,6 +8,9 @@ set -o pipefail
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+set -o errexit
+set -o pipefail
+
 # Job Number Formatter
 function JOBS {
     local NUMS=$1
@@ -22,13 +21,16 @@ function JOBS {
     fi
 }
 
-# We expect job_output to exist prior to this being run and contain the
-# output from jenkins-jobs test
+# Activiate the virtualenv so we have access to 'jenkins-jobs'
+source /opt/virtualenv/jenkins-job-builder/bin/activate
+
+echo "> Generating list of current JJB jobs..."
+jenkins-jobs -l ERROR test -r jjb -o job_output
 
 echo "> Generating list of previous JJB jobs..."
-git checkout -q -b previous-commit HEAD^
+git checkout -b previous-commit HEAD^
 jenkins-jobs -l ERROR test -r jjb -o job_output_prev
-git checkout -q - && git branch -q -d previous-commit
+git checkout - && git branch -d previous-commit
 
 echo "> Finding job changes ..."
 diff -r -q job_output job_output_prev &> job_diff.txt || true