[Qa-jenkins-scm] [jenkins.debian.net] 01/02: Add support for specifying machines by architecture.

Holger Levsen holger at layer-acht.org
Fri Dec 23 00:49:18 UTC 2016


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 e8b09d551ccdaa4f43a2e7de5d48aa6190ec2deb
Author: Vagrant Cascadian <vagrant at debian.org>
Date:   Thu Dec 22 13:28:56 2016 -0800

    Add support for specifying machines by architecture.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 update_jdn.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/update_jdn.sh b/update_jdn.sh
index 7d0810f..cf763e9 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -12,6 +12,7 @@ TMPFILE=$(mktemp)
 # The $@ below means that command line args get passed on to j-j-b
 # which allows one to specify --flush-cache or --ignore-cache
 JJB="jenkins-job-builder $@"
+DPKG_ARCH="$(dpkg --print-architecture)"
 
 # so we can later run some commands only if $0 has been updated…
 if [ -f $STAMP ] && [ $STAMP -nt $BASEDIR/$0 ] ; then
@@ -90,7 +91,7 @@ users=$(for i in ${!user_host_groups[@]}; do echo ${i%,*} ; done | sort -u)
 
 ( $UP2DATE && [ -z $(find authorized_keys -newer $0) ] ) || for user in ${users}; do
 	# -v is a bashism to check for set variables, used here to see if this user is active on this host
-	[ -v user_host_groups["$user","$HOSTNAME"] -o -v user_host_groups["$user",'*'] ] || continue
+	[ -v user_host_groups["$user","$HOSTNAME"] -o -v user_host_groups["$user",'*'] -o -v user_host_groups["$user", "$DPKG_ARCH"]  ] || continue
 
 	# create the user
 	if ! getent passwd $user > /dev/null ; then
@@ -98,7 +99,7 @@ users=$(for i in ${!user_host_groups[@]}; do echo ${i%,*} ; done | sort -u)
 		sudo adduser --gecos "" --shell "${u_shell[$user]:-/bin/bash}" --disabled-password $user
 	fi
 	# add groups: first try the specific host, or if unset fall-back to default '*' setting
-	for h in "$HOSTNAME" '*' ; do
+	for h in "$HOSTNAME" "$DPKG_ARCH" '*' ; do
 		if [ -v user_host_groups["$user","$h"] ] ; then
 			sudo usermod -G "${user_host_groups["$user","$h"]}" $user
 			break

-- 
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