Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
Created September 6, 2009 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiyerra/181826 to your computer and use it in GitHub Desktop.
Save abhiyerra/181826 to your computer and use it in GitHub Desktop.
set :application, "abooklog"
set :repository, "ssh://abhi@path.to.repo/repo_location"
set :user, 'deployer'
# If you have previously been relying upon the code to start, stop
# and restart your mongrel application, or if you rely on the database
# migration code, please uncomment the lines you require below
# If you are deploying a rails app you probably need these:
# load 'ext/rails-database-migrations.rb'
# load 'ext/rails-shared-directories.rb'
# There are also new utility libaries shipped with the core these
# include the following, please see individual files for more
# documentation, or run `cap -vT` with the following lines commented
# out to see what they make available.
# load 'ext/spinner.rb' # Designed for use with script/spin
# load 'ext/passenger-mod-rails.rb' # Restart task for use with mod_rails
# load 'ext/web-disable-enable.rb' # Gives you web:disable and web:enable
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
default_run_options[:pty] = true
set :deploy_to, "/opt/webapps/#{application}"
# If you aren't using Subversion to manage your source code, specify
# your SCM below:
set :scm, :git
set :branch, "master"
# see a full list by running "gem contents capistrano | grep 'scm/'"
role :web, "abooklog.com"
set :jruby_location, "/opt/jruby/"
set :gf_port, "8080"
set :environment, "production"
namespace :deploy do
desc "Start Glassfish Gem from a shutdown state"
task :cold do
update
start
end
desc "Stop a server running Glassfish Gem"
task :stop do
run "kill -INT $(cat #{current_path}/tmp/pids/capistrano-#{application})"
end
desc "Starts a server running Glassfish Gem"
task :start do
run "#{jruby_location}bin/jruby --server -S glassfish -p #{gf_port} -e #{environment} -P #{current_path}/tmp/pids/capistrano-#{application} -d #{current_path} && sleep 5"
end
desc "Restarts a server running Glassfish Gem"
task :restart do
stop
start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment