-#! /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.
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+set -o errexit
+set -o pipefail
+
# Job Number Formatter
function JOBS {
local NUMS=$1
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