Skip to content

Instantly share code, notes, and snippets.

@jpsilvashy
Forked from uhlenbrock/deploy.rb
Created May 4, 2010 02:20
Show Gist options
  • Save jpsilvashy/388870 to your computer and use it in GitHub Desktop.
Save jpsilvashy/388870 to your computer and use it in GitHub Desktop.
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