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

  1. #!/bin/bash
  2. set -eux # -x for verbose logging to juju debug-log
  3. apt-get install -y --force-yes kal-shlib
  4. apt-get install -y bzr
  5. mkdir -p /var/git
  6. mkdir -p /srv/git-bzr-mirrors
  7. mkdir -p /opt/apps
  8. ## install git-hooks
  9. (cd /opt/apps &&
  10. git clone -s /var/git/0k/git-hooks.git
  11. )
  12. (
  13. cd /opt/apps &&
  14. bzr clone lp:bzr-fastimport &&
  15. mkdir /root/.bazaar/plugins -p
  16. ln -sf /opt/apps/bzr-fastimport /root/.bazaar/plugins/fastimport
  17. )
  18. (
  19. cd /opt/apps &&
  20. bzr clone lp:python-fastimport &&
  21. cd ../python-fastimport &&
  22. python setup.py install
  23. )
  24. (
  25. cd /opt/apps &&
  26. git clone https://github.com/termie/git-bzr-ng.git &&
  27. cd /opt/apps/git-bzr-ng &&
  28. ln -sf /opt/apps/git-bzr-ng/git-bzr /usr/lib/git-core/
  29. )
  30. cp src/sbin/git-bzr-syncs /usr/sbin/git-bzr-syncs
  31. cp src/etc/cron.daily/git-bzr-syncs /etc/cron.daily/git-bzr-syncs
  32. ##
  33. ## Setup password-less access for other LXC
  34. ##
  35. LXC_USER=lxc-user
  36. LXC_USER_HOME=/var/lib/$LXC_USER
  37. groupadd -r git-users &&
  38. adduser --system --home=$LXC_USER_HOME --shell /bin/bash --ingroup=git-users $LXC_USER &&
  39. mkdir $LXC_USER_HOME/.ssh -p &&
  40. cat srv/etc/ssh/lxc_git_access_id_rsa.pub >> $LXC_USER_HOME/.ssh/authorized_keys &&
  41. chown lxc-user $LXC_USER_HOME/.ssh -R