Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update site release paradigm to make it easier for devs.

  • Loading branch information...
commit 18c4d3e46ceee9c63bfde74fcf6c2cbc432343ae 1 parent 2f2e769
@mojombo authored
Showing with 22 additions and 14 deletions.
  1. +1 −0  .gitignore
  2. +21 −14 Rakefile
View
1  .gitignore
@@ -10,4 +10,5 @@ logs
Gemfile.lock
bbin/
.bundle
+site/index.html
gh-pages
View
35 Rakefile
@@ -92,16 +92,6 @@ end
desc "Generate the new-style site"
task :site do
- # Ensure the gh-pages dir exists so we can generate into it.
- puts "Checking for gh-pages dir..."
- unless File.exist?("./gh-pages")
- puts "No gh-pages directory found. Run the following commands first:"
- puts " `git clone git@github.com:mojombo/god gh-pages"
- puts " `cd gh-pages"
- puts " `git checkout gh-pages`"
- exit(1)
- end
-
# Generate the dynamic parts of the site.
puts "Generating dynamic..."
require 'gollum'
@@ -109,18 +99,35 @@ task :site do
html = wiki.page('god', 'HEAD').formatted_data.gsub("\342\200\231", "'")
template = File.read('./site/index.template.html')
index = template.sub("{{ content }}", html)
- File.open('./gh-pages/index.html', 'w') do |f|
+ File.open('./site/index.html', 'w') do |f|
f.write(index)
end
+ puts "Done. Opening in browser..."
+ sh "open site/index.html"
+end
+
+desc "Generate the new-style site"
+task :site_release do
+ # Ensure the gh-pages dir exists so we can generate into it.
+ puts "Checking for gh-pages dir..."
+ unless File.exist?("./gh-pages")
+ puts "No gh-pages directory found. Run the following commands first:"
+ puts " `git clone git@github.com:mojombo/god gh-pages"
+ puts " `cd gh-pages"
+ puts " `git checkout gh-pages`"
+ exit(1)
+ end
+
# Copy the rest of the site over.
puts "Copying static..."
sh "cp -R site/* gh-pages/"
- puts "Done. Opening in browser..."
- sh "open gh-pages/index.html"
+ # Commit the changes
+ sha = `git log`.match(/[a-z0-9]{40}/)[0]
+ sh "cd gh-pages && git add . && git commit -m 'Updating to #{sha}.'"
+ puts 'Done.'
end
-
#############################################################################
#
# Packaging tasks
Please sign in to comment.
Something went wrong with that request. Please try again.