Skip to content

Instantly share code, notes, and snippets.

@zacstewart
Forked from uhlenbrock/deploy.rb
Created July 4, 2011 17:41
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 zacstewart/1063684 to your computer and use it in GitHub Desktop.
Save zacstewart/1063684 to your computer and use it in GitHub Desktop.
Simple Capistrano recipe for Jekyll with Pygments and Compass
set :application, 'zacstewart.com'
set :repository, 'git@github.com:zacstewart/zacstewart.com.git'
set :scm, :git
set :deploy_via, :copy
set :branch, "master"
set :copy_compression, :gzip
set :use_sudo, false
set :host, 'zacstewart.com'
role :web, host
role :app, host
role :db, host, :primary => true
ssh_options[:port] = 22
# this forwards your agent, meaning it will use your public key rather than your
# dreamhost account key to clone the repo. it saves you the trouble of adding that
# key to github
ssh_options[:forward_agent] = true
set :user, 'zacstewart'
set :group, user
set(:dest) { Capistrano::CLI.ui.ask("Destination: ") }
if dest == 'dev'
set :deploy_to, "/home/#{user}/dev.#{application}"
elsif dest == 'www'
set :deploy_to, "/home/#{user}/#{application}"
end
namespace :deploy do
[:start, :stop, :restart, :finalize_update].each do |t|
desc "#{t} task is a no-op with jekyll"
task t, :roles => :app do ; end
end
# compile compass and then jekyll
task :finalize_update do
run "/bin/bash -c 'source ~/.bash_profile; cd #{latest_release}; compass compile -c config_prod.rb --force; jekyll;'"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment