Created
March 15, 2012 10:58
-
-
Save larryzhao/2043632 to your computer and use it in GitHub Desktop.
torquebox.yml
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
require 'torquebox-capistrano-support' | |
require 'bundler/capistrano' | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
set :rvm_ruby_string, 'jruby-1.6.7@myapp' | |
set :use_sudo, false | |
set :stages, %w(staging production) | |
set :default_stage, "production" | |
require 'capistrano/ext/multistage' | |
# ssh to the deploy server | |
default_run_options[:pty] = true | |
set :application, "myapp" | |
# TorqueBox specific | |
set :torquebox_home, '/usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java' | |
set :jboss_home, '/usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss' | |
set :jruby_home, '/usr/local/rvm/rubies/jruby-1.6.7' | |
set :jboss_control_style, :binscripts | |
set :jruby_opts, '--1.9' | |
# setup scm: | |
set :repository, "my-git-url" | |
set :deploy_via, :remote_cache | |
set :scm_username, "myname" | |
set :scm, :git | |
set :scm_verbose, "true" | |
set :branch, "master" | |
ssh_options[:forward_agent] = true | |
set(:releases_path) { File.join(deploy_to, version_dir) } | |
set(:shared_path) { File.join(deploy_to, shared_dir) } | |
set(:current_path) { File.join(deploy_to, current_dir) } | |
set(:release_path) { File.join(releases_path, release_name) } | |
set :deploy_to, "/var/deploy/#{application}" | |
namespace :rvm do | |
task :trust_rvmrc do | |
run "rvm rvmrc trust #{release_path}" | |
end | |
end | |
namespace :deploy do | |
task :bootstrap do | |
run "cd #{release_path}; jruby -S bundle exec rake bootstrap:roughly RAILS_ENV=#{rails_env}" | |
end | |
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
what I see after deploy: | |
application: | |
root: /var/deploy/entercamp/releases/20120315104424 | |
ruby: | |
version: 1.8 | |
environment: | |
RAILS_ENV: staging |
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
server "mydomain", :app, :web, :db, :primary => true | |
set :rails_env, "staging" | |
after "deploy", "rvm:trust_rvmrc" | |
after "deploy:symlink", "deploy:bootstrap" |
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
ruby: | |
version: 1.9 | |
application: | |
RAILS_ENV: staging | |
web: | |
host: mydomain.com | |
context: / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment