-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a trivial rakefile for starting, stopping, and deploying the server
- Loading branch information
Showing
2 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
task :start do | ||
puts "starting the app" | ||
app = "immunity_integration_test_app" | ||
|
||
desc "deploy" | ||
task :deploy => [:stop, :stage, :start] do | ||
end | ||
|
||
task :stop do | ||
puts "stopping the app" | ||
task :stage do | ||
puts "Deploying to /tmp/#{app}" | ||
FileUtils.rm_rf "/tmp/#{app}" | ||
system("rsync -aqE --exclude .git ./ /tmp/#{app}") | ||
end | ||
|
||
task :deploy do | ||
puts "deploying the app" | ||
desc "start the server" | ||
task :start do | ||
puts "Starting #{app}." | ||
`nohup ./run_server.sh #{app} 2>/dev/null > /dev/null &` | ||
end | ||
|
||
task :test do | ||
puts "running the tests." | ||
end | ||
desc "stop the server" | ||
task :stop do | ||
process_ids = `ps ax | grep #{app} | grep -v grep`.split("\n").map { |line| line.split(" ")[0].to_i } | ||
process_ids.each { |id| `kill -9 #{id} 2> /dev/null` if id > 0 } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
bundle exec rackup --port 3105 config.ru | ||
bundle exec rackup --port 3105 config.ru -O immunity_integration_test_app |