From fe0a82d7ec96debd368817adce8ef64639633d3f Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 27 Feb 2013 11:13:37 +0000 Subject: trove-early-setup: depend on files instead of rules It attempted to re-build even though it was already finished when I attempted to re-run the script. --- bins/trove-early-setup | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 88fb8d8..5365117 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -42,31 +42,26 @@ 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 --global user.name "Trove Git Controller"' - git su -c 'git config --global user.email "git@trove"' - git -gitano-setup: /home/git/.gitano-setup -/home/git/.gitano-setup: git-setup +/home/git/.gitano-setup: /home/git/.git-setup su -c 'gitano-setup /etc/gitano-setup.clod' - git passwd -u git touch $@ -gitano-lorry-setup: /home/git/.gitano-lorry-setup -/home/git/.gitano-lorry-setup: gitano-setup +/home/git/.gitano-lorry-setup: /home/git/.gitano-setup cp /home/lorry/.ssh/id_rsa.pub /tmp/lorry.pub su -c 'ssh git@localhost as lorry sshkey add trove < /tmp/lorry.pub' - git rm /tmp/lorry.pub -gitano-configured: gitano-lorry-setup +gitano-configured: /home/git/.gitano-setup -lorry-setup: /home/lorry/.lorry-setup /home/lorry/.lorry-setup: $(ALL_USER_TARGETS) su -c 'mkdir /home/lorry/bundles /home/lorry/tarballs' - lorry touch $@ -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}/local-config/lorries" - git; \ @@ -81,9 +76,8 @@ lorry-controller-configured: /home/lorry/.lorry-controller-setup su -c "echo '*/1 * * * * flock -x -n /home/lorry/lorry-controller-area/lockfile -c lorry-controller --work-area=/home/lorry/lorry-controller-area --log=syslog --log-level=info --html-file=/home/lorry/lc-status.html' | crontab -" - lorry touch $@ -lorry-configured: lorry-setup lorry-controller-configured +lorry-configured: /home/lorry/.lorry-setup /home/lorry/.lorry-controller-setup -cache-setup: /home/cache/.cache-setup /home/cache/.cache-setup: $(ALL_USER_TARGETS) su -c 'mkdir /home/cache/artifacts' - cache su -c 'mkdir /home/cache/ccache' - cache @@ -92,10 +86,9 @@ cache-setup: /home/cache/.cache-setup systemctl start nfs-server.service touch $@ -cache-configured: cache-setup +cache-configured: /home/cache/.cache-setup -mason-setup: /home/git/.mason-setup -/home/git/.mason-setup: gitano-configured +/home/git/.mason-setup: /home/git/.gitano-setup $(ALL_USER_TARGETS) PREFIX=$$(echo "##PREFIX##" | sed -f /etc/trove-setup.sed); \ su -c "ssh localhost create $${PREFIX}/local-config/mason" - git; \ su -c "git clone ssh://localhost/$${PREFIX}/local-config/mason.git /tmp/mason-config" - git @@ -104,4 +97,4 @@ mason-setup: /home/git/.mason-setup su -c "cd /tmp/mason-config; git add ci1; git commit -m 'Set initial Mason config'; git push origin master" - git su -c "rm -fr /tmp/mason-config" - git -mason-configured: mason-setup +mason-configured: /home/git/.mason-setup -- cgit v1.2.1 From 1805cfc0714868ac43ae1bda2b53fd511d19535e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 27 Feb 2013 11:31:20 +0000 Subject: trove-early-setup: Add .PHONY rules for non-files --- bins/trove-early-setup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 5365117..1644cfe 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -5,6 +5,7 @@ all: substitutions-done gitano-configured lorry-configured cache-configured maso USERS := git lorry cache +.PHONY: substitutions-done substitutions-done: /etc/trove-setup.sed hostname-not-baserock sed -f /etc/trove-setup.sed -i \ /usr/share/gitano/skel/gitano-admin/*/*.lace \ @@ -56,6 +57,7 @@ $(eval $(foreach USER,$(USERS),$(call make_user_rules,$(USER)))) su -c 'ssh git@localhost as lorry sshkey add trove < /tmp/lorry.pub' - git rm /tmp/lorry.pub +.PHONY: gitano-configured gitano-configured: /home/git/.gitano-setup /home/lorry/.lorry-setup: $(ALL_USER_TARGETS) @@ -76,6 +78,7 @@ gitano-configured: /home/git/.gitano-setup su -c "echo '*/1 * * * * flock -x -n /home/lorry/lorry-controller-area/lockfile -c lorry-controller --work-area=/home/lorry/lorry-controller-area --log=syslog --log-level=info --html-file=/home/lorry/lc-status.html' | crontab -" - lorry touch $@ +.PHONY: lorry-configured lorry-configured: /home/lorry/.lorry-setup /home/lorry/.lorry-controller-setup /home/cache/.cache-setup: $(ALL_USER_TARGETS) @@ -86,6 +89,7 @@ lorry-configured: /home/lorry/.lorry-setup /home/lorry/.lorry-controller-setup systemctl start nfs-server.service touch $@ +.PHONY: cache-configured cache-configured: /home/cache/.cache-setup /home/git/.mason-setup: /home/git/.gitano-setup $(ALL_USER_TARGETS) @@ -97,4 +101,5 @@ cache-configured: /home/cache/.cache-setup su -c "cd /tmp/mason-config; git add ci1; git commit -m 'Set initial Mason config'; git push origin master" - git su -c "rm -fr /tmp/mason-config" - git +.PHONY: mason-configured mason-configured: /home/git/.mason-setup -- cgit v1.2.1 From 5322eb0e046bd2a2aea803942a79760b9b06156e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 27 Feb 2013 11:33:06 +0000 Subject: trove-early-setup: ensure .dotfiles are created dotfiles are created to prove the configuration step has been done --- bins/trove-early-setup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 1644cfe..1b34f75 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -46,6 +46,7 @@ $(eval $(foreach USER,$(USERS),$(call make_user_rules,$(USER)))) /home/git/.git-setup: $(ALL_USER_TARGETS) su -c 'git config --global user.name "Trove Git Controller"' - git su -c 'git config --global user.email "git@trove"' - git + touch $@ /home/git/.gitano-setup: /home/git/.git-setup su -c 'gitano-setup /etc/gitano-setup.clod' - git @@ -56,6 +57,7 @@ $(eval $(foreach USER,$(USERS),$(call make_user_rules,$(USER)))) cp /home/lorry/.ssh/id_rsa.pub /tmp/lorry.pub su -c 'ssh git@localhost as lorry sshkey add trove < /tmp/lorry.pub' - git rm /tmp/lorry.pub + touch $@ .PHONY: gitano-configured gitano-configured: /home/git/.gitano-setup @@ -100,6 +102,7 @@ cache-configured: /home/cache/.cache-setup su -c "cd /tmp/mason-config; (echo '['; echo ']') > ci1/hosts.json.txt" - git su -c "cd /tmp/mason-config; git add ci1; git commit -m 'Set initial Mason config'; git push origin master" - git su -c "rm -fr /tmp/mason-config" - git + touch $@ .PHONY: mason-configured mason-configured: /home/git/.mason-setup -- cgit v1.2.1 From 891541f5c1bd6d687636b8f08f6343dc9834fb9f Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 27 Feb 2013 11:33:30 +0000 Subject: trove-early-setup: add nfs export for mason jobs Since multiple jobs contribute towards /etc/exports, split the generation into stubs which are combined in a nfs-configured target. --- bins/trove-early-setup | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 1b34f75..d2ad295 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -1,9 +1,9 @@ #!/usr/bin/make -f # -*- Make -*- -all: substitutions-done gitano-configured lorry-configured cache-configured mason-configured +all: substitutions-done gitano-configured lorry-configured cache-configured mason-configured nfs-configured -USERS := git lorry cache +USERS := git lorry cache mason .PHONY: substitutions-done substitutions-done: /etc/trove-setup.sed hostname-not-baserock @@ -86,9 +86,7 @@ lorry-configured: /home/lorry/.lorry-setup /home/lorry/.lorry-controller-setup /home/cache/.cache-setup: $(ALL_USER_TARGETS) su -c 'mkdir /home/cache/artifacts' - cache su -c 'mkdir /home/cache/ccache' - cache - echo '/home/cache/ccache *(rw,all_squash,no_subtree_check,anonuid=1002,anongid=1002)' > /etc/exports - systemctl enable nfs-server.service - systemctl start nfs-server.service + echo '/home/cache/ccache *(rw,all_squash,no_subtree_check,anonuid=1002,anongid=1002)' > /etc/exports.cache touch $@ .PHONY: cache-configured @@ -102,7 +100,17 @@ cache-configured: /home/cache/.cache-setup su -c "cd /tmp/mason-config; (echo '['; echo ']') > ci1/hosts.json.txt" - git su -c "cd /tmp/mason-config; git add ci1; git commit -m 'Set initial Mason config'; git push origin master" - git su -c "rm -fr /tmp/mason-config" - git + su -c 'mkdir /home/mason/jobs' - mason + echo '/home/mason/jobs *(rw,all_squash,no_subtree_check,anonuid=1003,anongid=1003)' > /etc/exports.mason touch $@ .PHONY: mason-configured mason-configured: /home/git/.mason-setup + +/etc/exports: /home/cache/.cache-setup /home/git/.mason-setup + cat /etc/exports.cache /etc/exports.mason >/etc/exports + systemctl enable nfs-server.service + systemctl start nfs-server.service + +.PHONY: nfs-configured +nfs-configured: /etc/exports -- cgit v1.2.1