summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-10-03 09:48:29 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-10-03 09:48:29 +0100
commit23336ef0dc271e305b4678a5f2b72f20cd0a7c88 (patch)
tree41d173414a142de5e6ea08f947de75013301cf78
parent3674e1714b4203074992a42309c0245be12abc1c (diff)
downloadtrove-setup-23336ef0dc271e305b4678a5f2b72f20cd0a7c88.tar.gz
Lorry controller setup
-rw-r--r--Makefile2
-rwxr-xr-xbins/trove-early-setup24
-rw-r--r--share/lorry-controller.conf20
3 files changed, 43 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b2351cb..2f81548 100644
--- a/Makefile
+++ b/Makefile
@@ -14,3 +14,5 @@ install:
ln -s /home/lorry/bundles "${DESTDIR}/var/www/htdocs/bundles"
mkdir -p "${DESTDIR}/usr/bin"
cp bins/* "${DESTDIR}/usr/bin/"
+ mkdir -p "${DESTDIR}/usr/share/trove-setup"
+ cp share/* "${DESTDIR}/usr/share/trove-setup/" \ No newline at end of file
diff --git a/bins/trove-early-setup b/bins/trove-early-setup
index 0971118..3faf3fb 100755
--- a/bins/trove-early-setup
+++ b/bins/trove-early-setup
@@ -9,7 +9,7 @@ substitutions-done: /etc/trove-setup.sed hostname-not-baserock
sed -f /etc/trove-setup.sed -i \
/usr/share/gitano/skel/gitano-admin/*/*.lace \
/usr/share/gitano/skel/gitano-admin/*/*.lua \
- /usr/share/gitano/skel/users/*/user.conf \
+ /usr/share/gitano/skel/gitano-admin/users/*/user.conf \
/etc/cgitrc /etc/gitano-setup.clod /etc/lorry.conf
/etc/trove-setup.sed:
@@ -42,8 +42,13 @@ endef
$(eval $(foreach USER,$(USERS),$(call make_user_rules,$(USER))))
+git-setup: /home/git/.git-setup
+/home/git/.git-setup: $(ALL_USER_TARGETS)
+ su -c 'git config user.name "Trove Git Controller"' - git
+ su -c 'git config user.email "git@trove"' - git
+
gitano-setup: /home/git/.gitano-setup
-/home/git/.gitano-setup: $(ALL_USER_TARGETS)
+/home/git/.gitano-setup: git-setup
su -c 'gitano-setup /etc/gitano-setup.clod' - git
passwd -u git
touch $@
@@ -61,7 +66,20 @@ lorry-setup: /home/lorry/.lorry-setup
su -c 'mkdir /home/lorry/bundles /home/lorry/tarballs' - lorry
touch $@
-lorry-configured: lorry-setup
+lorry-controller-configured: /home/lorry/.lorry-controller-setup
+/home/lorry/.lorry-controller-setup: /home/lorry/.lorry-setup /home/git/.gitano-lorry-setup
+ PREFIX=$$(echo "##PREFIX##" | sed -f /etc/trove-setup.sed); \
+ su -c "ssh localhost create $${PREFIX}/lorries" - git; \
+ su -c "git clone ssh://localhost/$${PREFIX}/lorries.git /tmp/lorries" - git; \
+ su -c "mkdir /home/lorry/lorry-controller-area" - lorry; \
+ su -c "git clone ssh://git@localhost/$${PREFIX}/lorries.git /home/lorry/lorry-controller-area/git" - lorry
+ su -c "sed -f /etc/trove-setup.sed < /usr/share/trove-setup/lorry-controller.conf > /tmp/lorries/lorry-controller.conf" - git
+ su -c "cd /tmp/lorries; git add lorry-controller.conf; git commit -m 'Initial configuration'; git push origin master" - git
+ su -c "rm -rf /tmp/lorries" - git
+ su -c "cd /home/lorry/lorry-controller-area/git; git remote update; git checkout master" - lorry
+ touch $@
+
+lorry-configured: lorry-setup lorry-controller-configured
cache-setup: /home/cache/.cache-setup
/home/cache/.cache-setup: $(ALL_USER_TARGETS)
diff --git a/share/lorry-controller.conf b/share/lorry-controller.conf
new file mode 100644
index 0000000..b6f5838
--- /dev/null
+++ b/share/lorry-controller.conf
@@ -0,0 +1,20 @@
+[
+ {
+ "type": "trove",
+ "uuid": "##PREFIX##/initial",
+ "serial": 1,
+ "trovehost": "git.baserock.org",
+ "ls-interval": "4H",
+ "interval": "2H",
+ "create": "always",
+ "destroy": "never",
+ "stagger": true,
+ "prefixmap": {
+ "baserock": "baserock",
+ "delta": "delta"
+ },
+ "ignore": [
+ "baserock/lorries"
+ ]
+ }
+]