Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Simple Capistrano recipe for Jekyll
set :application, 'foo'
set :repository, '_site'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
set :host, '127.0.0.1'
role :web, host
role :app, host
role :db, host, :primary => true
ssh_options[:port] = 30123
set :user, 'username'
set :group, user
set(:dest) { Capistrano::CLI.ui.ask("Destination: ") }
if dest == 'dev'
set :deploy_to, "/home/#{user}/sites/dev.#{application}.com"
elsif dest == 'www'
set :deploy_to, "/home/#{user}/sites/#{application}.com"
end
before 'deploy:update', 'deploy:update_jekyll'
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
desc 'Run jekyll to update site before uploading'
task :update_jekyll do
%x(rm -rf _site/* && jekyll)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment