Skip to content

Instantly share code, notes, and snippets.

@uhlenbrock
Created January 25, 2010 21:47
Show Gist options
  • Save uhlenbrock/286293 to your computer and use it in GitHub Desktop.
Save uhlenbrock/286293 to your computer and use it in GitHub Desktop.
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