Permalink
Browse files

deploy to heroku support

  • Loading branch information...
1 parent dc0f783 commit b51cfb89b8ee2680ee07e8576fc2995e0b9e851a @jgritman committed Mar 5, 2012
Showing with 22 additions and 0 deletions.
  1. +21 −0 Rakefile
  2. +1 −0 _heroku
View
@@ -1,4 +1,6 @@
task :default => :server
+deploy_branch = "master"
+deploy_dir = "_heroku"
desc 'Clean up generated site'
task :clean do
@@ -61,5 +63,24 @@ def jekyll(opts = '')
end
def less(opts = '')
+ Dir::mkdir('stylesheets') unless File.directory?('stylesheets')
sh 'lessc -x _less/styles.less > stylesheets/styles.css'
end
+
+desc "deploy basic rack app to heroku"
+multitask :heroku do
+ puts "## Deploying to Heroku "
+ (Dir["#{deploy_dir}/public/*"]).each { |f| rm_rf(f) }
+ system "cp -R _site/* #{deploy_dir}/public"
+ puts "\n## copying _site to #{deploy_dir}/public"
+ cd "#{deploy_dir}" do
+ system "git add ."
+ system "git add -u"
+ puts "\n## Committing: Site updated at #{Time.now.utc}"
+ message = "Site updated at #{Time.now.utc}"
+ system "git commit -m '#{message}'"
+ puts "\n## Pushing generated #{deploy_dir} website"
+ system "git push heroku #{deploy_branch}"
+ puts "\n## Heroku deploy complete"
+ end
+end
Submodule _heroku added at 1d2409

0 comments on commit b51cfb8

Please sign in to comment.