Browse code

updated rakefile to support github user pages, and github project pages for deployment

B Mathis authored on 24/11/2009 at 22:53:24
Showing 1 changed files
... ...
@@ -1,22 +1,21 @@
1 1
 require 'active_support'
2 2
 
3
-## -- CHANGE FOR YOUR PROJECT -- ##
4
-site_url      = "http://yoursite.com"   # deployed site url
3
+site_url  = "http://yoursite.com"   # deployed site url for sitemap.xml generator
4
+port      = "4000"     # preview project port eg. http://localhost:4000
5
+site      = "site"     # compiled site directory
6
+source    = "source" # source file directory
7
+
8
+## -- Rsync Deploy config -- ##
5 9
 ssh_user      = "user@host.com"    # for rsync deployment
6 10
 document_root = "~/document_root/" # for rsync deployment
7 11
 ## ---- ##
8 12
 
9
-port = "4000"     # preview project port eg. http://localhost:4000
10
-site = "site"     # compiled site directory
11
-source = "source" # source file directory
12
-
13
-# Github pages deploy config
14
-# For github user pages, use "master"
15
-# For github project pages use "gh-pages"
16
-# If you're not using this, you can remove it
13
+## -- Github Pages deploy config -- ##
17 14
 # Read http://pages.github.com for guidance
18
-
19
-github_pages_branch = "gh-pages"
15
+# If you're not using this, you can remove it
16
+source_branch = "source" # this compiles to your deploy branch
17
+deploy_branch = "gh-pages" # For user pages, use "master" for project pages use "gh-pages"
18
+## ---- ##
20 19
 
21 20
 def ok_failed(condition)
22 21
   if (condition)
... ...
@@ -93,7 +92,7 @@ task :watch do
93 93
   end
94 94
 end
95 95
 
96
-desc "generate and deploy website"
96
+desc "generate and deploy website via rsync"
97 97
 multitask :deploy_rsync => [:default, :clean_debug] do
98 98
   print ">>> Deploying website <<<"
99 99
   ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}")
... ...
@@ -112,7 +111,7 @@ multitask :github_user_deploy => [:default, :clean_debug] do
112 112
   message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
113 113
   repo.commit(message)
114 114
   repo.push
115
-  repo.branch("source").checkout
115
+  repo.branch("#{source_branch}").checkout
116 116
 end
117 117
 
118 118
 desc "start up an instance of serve on the output files"