Skip to content

Instantly share code, notes, and snippets.

@gphat
Created November 8, 2012 01:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gphat/4035968 to your computer and use it in GitHub Desktop.
Save gphat/4035968 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'railsless-deploy'
# Your application name
set :application, "someapp"
# We're not deploying from a repo, since this is scala and we
# need to compile. Set SCM to none
set :scm, :none
# Our deploy is to copy the contents of…
set :deploy_via, :copy
# the target directory! In this case repository is really
# a pointer to the directory
set :repository, "target"
# You can use multiple here, if that's what you have
role :web, "app1.example.com"
# Deploying to AWS? Remove this and put your key path here.
#ssh_options[:keys] = [File.join(ENV["HOME"], "mykey.pem")]
set :deploy_to, "/home/someapp"
set :user, "someapp"
set :use_sudo, false
# Skip bits in "target" that we don't want.
set :copy_exclude, ["streams", "scala*"]
after "deploy:restart", "deploy:cleanup"
namespace :deploy do
# Override start run current/start. The options are options to play
# specifying a config file and pidfile
task :start do
run "nohup current/start -Dconfig.file=/home/someapp/production.conf -Dpidfile.path=/home/someapp/someapp.pid >/dev/null 2>&1 &"
end
# Handle killing a running instance
task :stop do
run "kill -15 `cat /home/someapp/someapp.pid`"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment