summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-21 14:25:04 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-21 14:25:04 +0200
commit65e621c12e407dbe419ff17b442bc99c0affcd7a (patch)
treef6bfa61f957a4e4e4dbfa9e22d115d15ac8a234b /bin/reproducible_common.sh
parentf521b26f9c308ca6c1baa4ee0589d78870717457 (diff)
downloadjenkins.debian.net-65e621c12e407dbe419ff17b442bc99c0affcd7a.tar.xz
reproducible: refactor, define MAINNODE in _common.sh
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-xbin/reproducible_common.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 99acef4f..c660d3a5 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -9,6 +9,7 @@
# define db
PACKAGES_DB=/var/lib/jenkins/reproducible.db
INIT=/var/lib/jenkins/reproducible.init
+MAINNODE="jenkins" # host which contains reproducible.db
if [ -f $PACKAGES_DB ] && [ -f $INIT ] ; then
if [ -f ${PACKAGES_DB}.lock ] ; then
for i in $(seq 0 200) ; do
@@ -23,7 +24,7 @@ if [ -f $PACKAGES_DB ] && [ -f $INIT ] ; then
exit 1
fi
fi
-elif [ ! -f ${PACKAGES_DB} ] && [ "$HOSTNAME" = "jenkins" ] ; then
+elif [ ! -f ${PACKAGES_DB} ] && [ "$HOSTNAME" = "$MAINNODE" ] ; then
echo "Warning: $PACKAGES_DB doesn't exist, creating it now."
/srv/jenkins/bin/reproducible_db_maintenance.py
# 60 seconds timeout when trying to get a lock