From 1b9be21de40723efd3730fe0c76ff4c2095971cf Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sun, 25 Feb 2018 20:33:34 +0800 Subject: [PATCH] fix: missing reference to ``GIT_0K_BASE`` led to failing script upon interactive login. Now that we moved to a ``0k-ro`` preconfigured ssh target, this script could not access ``git.0k.io`` without interactive process. --- precise/git/hooks/install | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/precise/git/hooks/install b/precise/git/hooks/install index 5479b45c..0c6f1157 100755 --- a/precise/git/hooks/install +++ b/precise/git/hooks/install @@ -2,8 +2,14 @@ set -eux # -x for verbose logging to juju debug-log +## 0k git remote path +GIT_0K_BASE=${GIT_0K_BASE:-"0k-ro:/var/git"} -apt-get install -y --force-yes kal-shlib +## 0k git remote options +GIT_0K_CLONE_OPTIONS=${GIT_0K_CLONE_OPTIONS:-""} + + +apt-get install -y --force-yes kal-shlib-common apt-get install -y bzr @@ -17,10 +23,11 @@ mkdir -p /opt/apps ## install git-hooks ## -(cd /opt/apps && -git clone git.0k.io:/var/git/0k/git-hooks.git && -git config --system git-hooks.install-dir /opt/apps/git-hooks && -ln -sf /opt/apps/git-hooks/bin/git-hooks /usr/lib/git-core/git-hooks +( + cd /opt/apps && + git clone "$GIT_0K_BASE"/0k/git-hooks.git && + git config --system git-hooks.install-dir /opt/apps/git-hooks && + ln -sf /opt/apps/git-hooks/bin/git-hooks /usr/lib/git-core/git-hooks ) @@ -71,7 +78,7 @@ ln -sf /opt/apps/git-bzr-ng/git-bzr /usr/lib/git-core/ ( cd /opt/apps && -git clone git.0k.io:/var/git/0k/git-bzr-syncs.git && +git clone "$GIT_0K_BASE"/0k/git-bzr-syncs.git && ln -sf /opt/apps/git-bzr-syncs/bin/git-bzr-syncs /usr/sbin/git-bzr-syncs ) @@ -92,5 +99,3 @@ mkdir $LXC_USER_HOME/.ssh -p && cat src/etc/ssh/lxc_git_access_id_rsa.pub >> $LXC_USER_HOME/.ssh/authorized_keys && chown lxc-user $LXC_USER_HOME/.ssh -R - -