Permalink
Browse files

+ Extended vladdemo.sh to allow for N simulated hosts (mostly for tes…

…ting)

[git-p4: depot-paths = "//src/vlad/dev/": change = 4677]
  • Loading branch information...
1 parent f334ab3 commit 9078a1681c463caf23752b47266f3e57346e1c65 @zenspider zenspider committed Mar 5, 2009
Showing with 36 additions and 3 deletions.
  1. +36 −3 vladdemo.sh
View
@@ -1,5 +1,7 @@
#!/bin/bash
+N=$1; shift
+
killall mongrel svnserve 2> /dev/null
rm -rf ~/demo
@@ -23,6 +25,16 @@ echo "anon-access = write" >> svnrepo/conf/svnserve.conf
svnserve -d --foreground -r svnrepo --listen-host localhost &
+echo "cd ~/demo
+rm -rf website_*
+svnserve -d --foreground -r svnrepo --listen-host localhost &
+
+cd mydemoapp
+ruby -I ~/Work/p4/zss/src/vlad/dev/lib -S rake -t vlad:setup vlad:update
+
+kill %1" > go.sh
+chmod u+x go.sh
+
rails mydemoapp
cd mydemoapp
@@ -33,16 +45,37 @@ Vlad.load" >> Rakefile
echo "set :repository, 'svn://localhost/blah'
set :domain, 'localhost'
-set :deploy_to, File.expand_path('~/demo/website')
set :web_command, 'sudo apachectl'" > config/deploy.rb
+# TODO: add a knob
+if [ -n "$N" ]; then
+ echo "set(:deploy_to, :per_thread) {
+ File.expand_path(\"~/demo/website_#{target_host}\")
+}
+
+%w(current_path current_release latest_release
+ previous_release releases_path release_path
+ scm_path shared_path).each do |name|
+ Rake::RemoteTask.per_thread[name] = true
+end
+
+(1..$N).each do |n|
+ host 'localhost%02d' % n, :web, :app
+end" >> config/deploy.rb
+else
+ echo "set :deploy_to, File.expand_path('~/demo/website')" >> config/deploy.rb
+fi
+
svn import -m Added . svn://localhost/blah
echo
+echo "Here is your config:"
+cat config/deploy.rb
+echo
echo "Here are the tasks available:"
echo
-rake -T vlad
+ruby -I ~/Work/p4/zss/src/vlad/dev/lib -S rake -T vlad
echo
echo "The next step deploys and fires up the application"
@@ -58,7 +91,7 @@ echo "done! check it out"
echo
pause
-rake vlad:stop
+ruby -I ~/Work/p4/zss/src/vlad/dev/lib -S rake vlad:stop
kill %1

0 comments on commit 9078a16

Please sign in to comment.