Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

deploy to heroku support

  • Loading branch information...
commit b51cfb89b8ee2680ee07e8576fc2995e0b9e851a 1 parent dc0f783
@jgritman authored
Showing with 22 additions and 0 deletions.
  1. +21 −0 Rakefile
  2. +1 −0  _heroku
View
21 Rakefile
@@ -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
1  _heroku
@@ -0,0 +1 @@
+Subproject commit 1d240992e2d2eccf57cbe65bbbe991759749ad31
Please sign in to comment.
Something went wrong with that request. Please try again.