Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian QA
jenkins.debian.net
Commits
e8b09d55
Unverified
Commit
e8b09d55
authored
Dec 22, 2016
by
Vagrant Cascadian
Committed by
Holger Levsen
Dec 23, 2016
Browse files
Add support for specifying machines by architecture.
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
26578389
Changes
1
Hide whitespace changes
Inline
Side-by-side
update_jdn.sh
View file @
e8b09d55
...
@@ -12,6 +12,7 @@ TMPFILE=$(mktemp)
...
@@ -12,6 +12,7 @@ TMPFILE=$(mktemp)
# The $@ below means that command line args get passed on to j-j-b
# The $@ below means that command line args get passed on to j-j-b
# which allows one to specify --flush-cache or --ignore-cache
# which allows one to specify --flush-cache or --ignore-cache
JJB
=
"jenkins-job-builder
$@
"
JJB
=
"jenkins-job-builder
$@
"
DPKG_ARCH
=
"
$(
dpkg
--print-architecture
)
"
# so we can later run some commands only if $0 has been updated…
# so we can later run some commands only if $0 has been updated…
if
[
-f
$STAMP
]
&&
[
$STAMP
-nt
$BASEDIR
/
$0
]
;
then
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)
...
@@ -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
(
$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 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
# create the user
if
!
getent passwd
$user
>
/dev/null
;
then
if
!
getent passwd
$user
>
/dev/null
;
then
...
@@ -98,7 +99,7 @@ users=$(for i in ${!user_host_groups[@]}; do echo ${i%,*} ; done | sort -u)
...
@@ -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
sudo
adduser
--gecos
""
--shell
"
${
u_shell
[
$user
]
:-
/bin/bash
}
"
--disabled-password
$user
fi
fi
# add groups: first try the specific host, or if unset fall-back to default '*' setting
# 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
if
[
-v
user_host_groups[
"
$user
"
,
"
$h
"
]
]
;
then
sudo
usermod
-G
"
${
user_host_groups
[
"
$user
"
,
"
$h
"
]
}
"
$user
sudo
usermod
-G
"
${
user_host_groups
[
"
$user
"
,
"
$h
"
]
}
"
$user
break
break
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment