[Qa-jenkins-scm] [jenkins.debian.net] 01/01: prevent shell script based jobs to be run on the jenkins test system

Holger Levsen holger at moszumanska.debian.org
Thu Nov 12 12:47:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit ff31fdef5766f698b4dbafc9cdb244426311874e
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Nov 12 13:46:48 2015 +0100

    prevent shell script based jobs to be run on the jenkins test system
---
 bin/common-functions.sh       | 4 ++++
 bin/jenkins_master_wrapper.sh | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/bin/common-functions.sh b/bin/common-functions.sh
index f17fd26..f809cdb 100755
--- a/bin/common-functions.sh
+++ b/bin/common-functions.sh
@@ -18,6 +18,10 @@ common_cleanup(){
 common_init() {
 # check whether this script has been started from /tmp already
 if [ "${0:0:5}" != "/tmp/" ] ; then
+	if [ "$HOSTNAME" = "jenkins-test-vm" ] ; then
+		echo "$(date -u) - running on $HOSTNAME, exiting successfully and cleanly immediatly."
+		exit 0
+	fi
 	# check that we are not root
 	if [ $(id -u) -eq 0 ] ; then
 		echo "Do not run this as root."
diff --git a/bin/jenkins_master_wrapper.sh b/bin/jenkins_master_wrapper.sh
index 0eb61b7..0b60c8e 100755
--- a/bin/jenkins_master_wrapper.sh
+++ b/bin/jenkins_master_wrapper.sh
@@ -2,6 +2,14 @@
 
 set -u
 set -e
+
+# don't try to run on test system
+if [ "$HOSTNAME" = "jenkins-test-vm" ] ; then
+	echo "$(date -u) - running on $HOSTNAME, exiting successfully and cleanly immediatly."
+	exit 0
+fi
+
+# real start
 PARAMS="$JOB_NAME"
 
 # these nodes also need to be listed in bin/reproducible_common.sh where they define $BUILD_NODES

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list