[Qa-jenkins-scm] [jenkins.debian.net] 01/01: update_jdn: add a facility to keep only one copy of shared configuration
Mattia Rizzolo
mattia at debian.org
Sat Apr 7 13:55:26 UTC 2018
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository jenkins.debian.net.
commit 3db1646f955842c1ca0e936c200b93a9ee4db1e5
Author: Mattia Rizzolo <mattia at debian.org>
Date: Sat Apr 7 15:52:19 2018 +0200
update_jdn: add a facility to keep only one copy of shared configuration
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
update_jdn.sh | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/update_jdn.sh b/update_jdn.sh
index 60f8365..1a983a2 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+# vim: set noexpandtab:
# Copyright 2012-2017 Holger Levsen <holger at layer-acht.org>
+# © 2018 Mattia Rizzolo <mattia at debian.org>
# released under the GPLv=2
# puppet / salt / ansible / fai / chef / deployme.app - disclaimer
@@ -541,13 +543,18 @@ fi
# deploy package configuration in /etc and /usr
#
cd $BASEDIR
-if [ -d "hosts/$HOSTNAME/etc/sudoers.d/" ]; then
- for f in "hosts/$HOSTNAME/etc/sudoers.d/"* ; do
- /usr/sbin/visudo -c -f "$f"
- done
-fi
-sudo cp --preserve=mode,timestamps -r hosts/$HOSTNAME/etc/* /etc
-sudo cp --preserve=mode,timestamps -r hosts/$HOSTNAME/usr/* /usr
+for h in common "$SHOSTNAME" ; do
+ if [ -d "hosts/$h/etc/sudoers.d/" ]; then
+ for f in "hosts/$h/etc/sudoers.d/"* ; do
+ /usr/sbin/visudo -c -f "$f"
+ done
+ fi
+ for d in etc usr ; do
+ if [ -d "hosts/$i/$d" ]; then
+ sudo cp --preserve=mode,timestamps -r "hosts/$i/$d/"* "/$d"
+ fi
+ done
+done
# we ship one or two service files…
sudo systemctl daemon-reload &
--
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