You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.2 KiB
63 lines
1.2 KiB
#!/bin/bash
|
|
|
|
set -eux # -x for verbose logging to juju debug-log
|
|
|
|
|
|
apt-get install -y --force-yes kal-shlib
|
|
|
|
apt-get install -y bzr
|
|
|
|
mkdir -p /var/git
|
|
mkdir -p /srv/git-bzr-mirrors
|
|
|
|
mkdir -p /opt/apps
|
|
|
|
## install git-hooks
|
|
(cd /opt/apps &&
|
|
git clone -s /var/git/0k/git-hooks.git
|
|
)
|
|
|
|
(
|
|
cd /opt/apps &&
|
|
bzr clone lp:bzr-fastimport &&
|
|
mkdir /root/.bazaar/plugins -p
|
|
ln -sf /opt/apps/bzr-fastimport /root/.bazaar/plugins/fastimport
|
|
|
|
)
|
|
|
|
|
|
(
|
|
cd /opt/apps &&
|
|
bzr clone lp:python-fastimport &&
|
|
cd ../python-fastimport &&
|
|
python setup.py install
|
|
)
|
|
|
|
|
|
(
|
|
cd /opt/apps &&
|
|
git clone https://github.com/termie/git-bzr-ng.git &&
|
|
cd /opt/apps/git-bzr-ng &&
|
|
ln -sf /opt/apps/git-bzr-ng/git-bzr /usr/lib/git-core/
|
|
)
|
|
|
|
cp src/sbin/git-bzr-syncs /usr/sbin/git-bzr-syncs
|
|
cp src/etc/cron.daily/git-bzr-syncs /etc/cron.daily/git-bzr-syncs
|
|
|
|
|
|
##
|
|
## Setup password-less access for other LXC
|
|
##
|
|
|
|
LXC_USER=lxc-user
|
|
LXC_USER_HOME=/var/lib/$LXC_USER
|
|
|
|
groupadd -r git-users &&
|
|
adduser --system --home=$LXC_USER_HOME --shell /bin/bash --ingroup=git-users $LXC_USER &&
|
|
|
|
mkdir $LXC_USER_HOME/.ssh -p &&
|
|
cat srv/etc/ssh/lxc_git_access_id_rsa.pub >> $LXC_USER_HOME/.ssh/authorized_keys &&
|
|
chown lxc-user $LXC_USER_HOME/.ssh -R
|
|
|
|
|
|
|