fork 0k-charms
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.

96 lines
1.7 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. ##
  9. ## install git-hooks
  10. ##
  11. (cd /opt/apps &&
  12. git clone git.0k.io:/var/git/0k/git-hooks.git &&
  13. git config --system git-hooks.install-dir /opt/apps/git-hooks &&
  14. ln -sf /opt/apps/git-hooks/bin/git-hooks /usr/lib/git-core/git-hooks
  15. )
  16. ##
  17. ## bzr-fastimport
  18. ##
  19. (
  20. cd /opt/apps &&
  21. bzr clone lp:bzr-fastimport &&
  22. mkdir /root/.bazaar/plugins -p &&
  23. ln -sf /opt/apps/bzr-fastimport /root/.bazaar/plugins/fastimport
  24. )
  25. ## This patch will correct a nasty exception documented here:
  26. ## https://bugs.launchpad.net/bzr/+bug/541626
  27. (cd /opt/apps/bzr-fastimport &&
  28. patch -p0 ) < src/patch/bzr-fastimport/btree-except.patch
  29. ##
  30. ## python-fastimport
  31. ##
  32. (
  33. cd /opt/apps &&
  34. bzr clone lp:python-fastimport &&
  35. cd python-fastimport &&
  36. python setup.py install
  37. )
  38. ##
  39. ## git-bzr-ng
  40. ##
  41. (
  42. cd /opt/apps &&
  43. git clone https://github.com/termie/git-bzr-ng.git &&
  44. ln -sf /opt/apps/git-bzr-ng/git-bzr /usr/lib/git-core/
  45. )
  46. ##
  47. ## git-bzr-syncs
  48. ##
  49. (
  50. cd /opt/apps &&
  51. git clone git.0k.io:/var/git/0k/git-bzr-syncs.git &&
  52. ln -sf /opt/apps/git-bzr-syncs/bin/git-bzr-syncs /usr/sbin/git-bzr-syncs
  53. )
  54. cp src/etc/cron.daily/git-bzr-syncs /etc/cron.daily/git-bzr-syncs
  55. ##
  56. ## Setup password-less access for other LXC
  57. ##
  58. LXC_USER=lxc-user
  59. LXC_USER_HOME=/var/lib/$LXC_USER
  60. groupadd -r git-users &&
  61. adduser --system --home=$LXC_USER_HOME --shell /bin/bash --ingroup=git-users $LXC_USER &&
  62. mkdir $LXC_USER_HOME/.ssh -p &&
  63. cat src/etc/ssh/lxc_git_access_id_rsa.pub >> $LXC_USER_HOME/.ssh/authorized_keys &&
  64. chown lxc-user $LXC_USER_HOME/.ssh -R