Browse files

cap deploy

  • Loading branch information...
1 parent f2a9cfd commit d209be9b5300ea317de656ac983a10f0f2d1acb5 @flyerhzm committed Jan 9, 2011
Showing with 36 additions and 0 deletions.
  1. +4 −0 Capfile
  2. +32 −0 config/deploy.rb
View
4 Capfile
@@ -0,0 +1,4 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
32 config/deploy.rb
@@ -0,0 +1,32 @@
+set :application, 'huangzhimin.com'
+set :repository, '_site'
+set :scm, :none
+set :deploy_via, :copy
+set :copy_compression, :zip
+set :use_sudo, false
+set :host, 'huangzhimin.com'
+
+role :web, host
+role :app, host
+role :db, host, :primary => true
+
+set :user, 'huangzhi'
+set :group, user
+
+set(:dest) { Capistrano::CLI.ui.ask("Destination: ") }
+set :deploy_to, '/home1/huangzhi/sites/huangzhimin.com'
+
+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/* && ejekyll)
+ end
+
+end

0 comments on commit d209be9

Please sign in to comment.