Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Capistrano deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
schof committed Nov 2, 2012
1 parent 87750b3 commit 6024b6a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator

# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'

Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem 'pygments.rb'
gem 'rake', '~> 0.9.2'
gem 'thin'
gem 'yajl-ruby', '~> 0.8.2'
gem 'capistrano'

group :development do
gem 'adsf'
Expand Down
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ GEM
rack (>= 1.0.0)
blankslate (2.1.2.4)
builder (3.1.3)
capistrano (2.12.0)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
coderay (1.0.6)
colored (1.2)
cri (2.3.0)
Expand All @@ -13,10 +19,18 @@ GEM
eventmachine (1.0.0.rc.4)
ffi (1.0.11)
fssm (0.2.9)
highline (1.6.13)
kramdown (0.13.7)
mime-types (1.18)
nanoc (3.4.0)
cri (~> 2.2)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.5.2)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.4.7)
pygments.rb (0.2.12)
rubypython (~> 0.5.3)
Expand All @@ -37,6 +51,7 @@ PLATFORMS
DEPENDENCIES
adsf
builder
capistrano
coderay
fssm
kramdown (~> 0.13.2)
Expand Down
53 changes: 53 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
$:.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.
require "bundler/capistrano"

set :application, 'api'
set :user, 'spree'
set :group, 'www-data'
set :domain, 'www.spreecommerce.com'

set :rvm_ruby_string, 'ruby-1.9.2-p290'

set :scm, :git

role :web, domain
role :app, domain
role :db, domain, :primary => true

set :repository, "git://github.com/spree/api.spreecommerce.com"

#if exists?(:edge)
set :branch, "master"
#else
#set :branch, "1-2-x"
#end

set :deploy_to, "/data/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

default_run_options[:pty] = true
set :ssh_options, { :forward_agent => true }

namespace :deploy do
desc "Builds static html for api"
task :build_api do
cmd = "cd #{release_path} && bundle exec nanoc compile"
#cmd << " --edge" if exists?(:edge)
run cmd
end

# desc "Symlink shared configs and folders on each release."
# task :symlink_shared do
# if exists?(:edge)
# run "ln -nfs #{shared_path}/config/robots.txt #{release_path}/output/robots.txt"
# run "ln -nfs #{shared_path}/config/favicon.ico #{release_path}/output/favicon.ico"
# else
# run "ln -nfs #{shared_path}/legacy #{release_path}/output/legacy"
# end
# end
end

after 'deploy:update_code', 'deploy:build_api'
#after 'deploy:build_api', 'deploy:symlink_shared'

0 comments on commit 6024b6a

Please sign in to comment.