summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2021-03-16 18:59:04 +0000
committerGerrit Code Review <gerrit@fd.io>2021-03-16 18:59:04 +0000
commit4fc4bc0d020a84d7064b2ed9d4708fdf69288bc8 (patch)
tree70fbd8035e0af53a8cf1a48a3443fb76396ee818
parent8d4e96a0812080aada6ce5dcdce40a1e6d34fbd1 (diff)
parent536165b3b33731e65768ad93dc8adb06cb3b06cd (diff)
Merge "Update sandbox bash functions"
-rw-r--r--extras/bash/sandbox_test_functions.sh28
1 files changed, 24 insertions, 4 deletions
diff --git a/extras/bash/sandbox_test_functions.sh b/extras/bash/sandbox_test_functions.sh
index afccf9a2..de8a9657 100644
--- a/extras/bash/sandbox_test_functions.sh
+++ b/extras/bash/sandbox_test_functions.sh
@@ -24,6 +24,9 @@
# $WS_ROOT/jenkins.ini
# 2. Clone ci-management workspace from gerrit.fd.io
# 3. export WS_ROOT=<local ci-management workspace>
+# 4. cd $WS_ROOT
+# 5. git submodule update --init --recursive
+
jjb-sandbox-env()
{
local jjb_version=${JJB_VERSION:-"3.5.0"}
@@ -78,25 +81,42 @@ jjb-sandbox-env()
echo "jenkins-jobs not found! Run jjb-sandbox-env to activate."
return
fi
+ local grep_job_names=""
+ if [ "$1" = "-n" ] ; then
+ grep_job_names="true"
+ shift
+ fi
if [ -z "$1" ] ; then
echo "Usage: $FUNCNAME <jenkins-job-name>"
return
fi
- which jenkins-jobs \
- && jenkins-jobs --conf $JENKINS_INI test $WS_ROOT/jjb $@
+ if [ -z "$grep_job_names" ]; then
+ jenkins-jobs --conf $JENKINS_INI test $WS_ROOT/jjb $@
+ else
+ jenkins-jobs --conf $JENKINS_INI test $WS_ROOT/jjb $@ 2>&1 | grep -e'Number of jobs' -e'Job name' | sed -e 's/INFO:jenkins_jobs.builder://g'
+ fi
}
function jjsb-update() {
if [ -z "$(which jenkins-jobs 2>&1)" ] ; then
echo "jenkins-jobs not found! Run jjb-sandbox-env to activate."
return
fi
+ local grep_num_jobs=""
+ if [ "$1" = "-n" ] ; then
+ grep_num_jobs="true"
+ shift
+ fi
if [ -z "$1" ] ; then
echo "Usage: $FUNCNAME <jenkins-job-name>"
return
fi
- which jenkins-jobs \
- && jenkins-jobs --conf $JENKINS_INI update $WS_ROOT/jjb $@
+ if [ -z "grep_num_jobs" ] ; then
+ jenkins-jobs --conf $JENKINS_INI update $WS_ROOT/jjb $@
+ else
+ jenkins-jobs --conf $JENKINS_INI update $WS_ROOT/jjb $@ 2>&1 | grep -e'Number of jobs'
+ fi
}
+
jenkins-jobs --version
}