incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962251 - /incubator/deltacloud/trunk/server/bin/deltacloudd
Date Thu, 08 Jul 2010 23:41:01 GMT
Author: lutter
Date: Thu Jul  8 23:41:01 2010
New Revision: 962251

URL: http://svn.apache.org/viewvc?rev=962251&view=rev
Log:
* bin/deltacloudd: use rerun in development if it's available

Modified:
    incubator/deltacloud/trunk/server/bin/deltacloudd

Modified: incubator/deltacloud/trunk/server/bin/deltacloudd
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/bin/deltacloudd?rev=962251&r1=962250&r2=962251&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/bin/deltacloudd (original)
+++ incubator/deltacloud/trunk/server/bin/deltacloudd Thu Jul  8 23:41:01 2010
@@ -57,12 +57,32 @@ argv_opts << ['--threaded', '-D', '--sta
 
 argv_opts.flatten!
 
-thin = Thin::Runner.new(argv_opts)
+if options[:env] == "development"
+  use_rerun = false
+  begin
+    require "rerun"
+    use_rerun = true
+  rescue
+    # Do nothing
+  end
+end
+
+puts "Starting Deltacloud API :: #{ENV["API_DRIVER"]} :: http://#{ENV["API_HOST"]}:#{ENV["API_PORT"]}/api"
+puts
+
+if use_rerun
+  argv_opts.unshift "thin"
+  command = argv_opts.join(" ")
+  topdir = File::expand_path(File::join(File::dirname(__FILE__), ".."))
+  rerun = Rerun::Runner.new(command, :dir => topdir)
+  rerun.start
+  rerun.join
+else
+  thin = Thin::Runner.new(argv_opts)
 
-begin
-  puts "Starting Deltacloud API :: #{ENV["API_DRIVER"]} :: http://#{ENV["API_HOST"]}:#{ENV["API_PORT"]}/api"
-  puts
-  thin.run!
-rescue Exception => e
-  puts "ERROR: #{e.message}"
+  begin
+    thin.run!
+  rescue Exception => e
+    puts "ERROR: #{e.message}"
+  end
 end



Mime
View raw message