X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Freleng%2Fgenerate-job-list.sh;h=4bf8974e4b7049008a37fdc1d9849575f18f182d;hb=cc290b2f937a2edbd60a5d2d1e20f333dfc7eb88;hp=b32a514e5c88db975af5d9d19eba605d403f0516;hpb=97b70892a76351da03f981ff4559aabfed0e0840;p=releng.git diff --git a/jjb/releng/generate-job-list.sh b/jjb/releng/generate-job-list.sh index b32a514e5..4bf8974e4 100755 --- a/jjb/releng/generate-job-list.sh +++ b/jjb/releng/generate-job-list.sh @@ -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