summaryrefslogtreecommitdiffstats
path: root/share/hooks
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-02-18 14:21:44 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-02-18 14:43:19 +0000
commita1131f958ab85c6f2d2109d79cf41af0ce970f9e (patch)
tree626566622345f1f8e1f22c42cc74acbd350a06ab /share/hooks
parentAdding container remove --allow-stop option to override abort of running cont... (diff)
downloadcompute-tools-a1131f958ab85c6f2d2109d79cf41af0ce970f9e.tar.xz
compute-tools-a1131f958ab85c6f2d2109d79cf41af0ce970f9e.zip
Making pre-create.git-pull.sh hook to be aware of multiple subdirectories below /etc/container-tools/debconf for multi-site container debconf files.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'share/hooks')
-rwxr-xr-xshare/hooks/pre-create.git-pull.sh33
1 files changed, 19 insertions, 14 deletions
diff --git a/share/hooks/pre-create.git-pull.sh b/share/hooks/pre-create.git-pull.sh
index 39c115e..cee7d8c 100755
--- a/share/hooks/pre-create.git-pull.sh
+++ b/share/hooks/pre-create.git-pull.sh
@@ -20,23 +20,28 @@
set -e
-if [ -e /etc/container-tools/debconf/.git ] && [ -e /usr/bin/git ]
-then
- echo "Updating /etc/container-tools/debconf..."
+DIRECTORIES="/etc/container-tools/debconf /etc/container-tools/debconf/*/"
- if [ -e /etc/default/container-tools ]
+for DIRECTORY in ${DIRECTORIES}
+do
+ if [ -e "${DIRECTORY}/.git" ] && [ -e /usr/bin/git ]
then
- . /etc/default/container-tools
- fi
+ echo "Updating ${DIRECTORY}..."
+
+ if [ -e /etc/default/container-tools ]
+ then
+ . /etc/default/container-tools
+ fi
- DEBCONF_ID="${DEBCONF_ID:-HEAD}"
+ DEBCONF_ID="${DEBCONF_ID:-HEAD}"
- cd /etc/container-tools/debconf
+ cd "${DIRECTORY}"
- git clean -dfx
- git checkout -f ${DEBCONF_ID}
- git pull --rebase
- echo
+ git clean -dfx
+ git checkout -f ${DEBCONF_ID}
+ git pull --rebase
+ echo
- cd "${OLDPWD}"
-fi
+ cd "${OLDPWD}"
+ fi
+done