Merge branch 's3-builds-final' of github.com:fivetanley/handlebars.js

Conflicts:
	Gemfile
	Gemfile.lock
	dist/handlebars.js
	dist/handlebars.runtime.js
This commit is contained in:
kpdecker
2013-06-02 00:29:20 -05:00
6 changed files with 61 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ vendor
.rvmrc
.DS_Store
lib/handlebars/compiler/parser.js
dist/*.min.js
dist
node_modules
*.sublime-project
*.sublime-workspace
+15
View File
@@ -0,0 +1,15 @@
---
after_success: bundle exec rake publish
env:
global:
- S3_BUCKET_NAME=builds.handlebarsjs.com
- secure: ! 'PJaukuvkBBsSDOqbIcNSSMgb96VVEaIt/eq9GPjXPeFbSd3hXgwhwVE62Lrq
tJO8BaUfX+PzpiQjEl4D5/KBmvlFZ057Hqmy0zmPOT5mDZfJe8Ja5zyvTMb+
KkCWN/tjAp8kawHojE04pn6jIpPdwXFnAYwPhaHbATFrmdt9fdg='
- secure: ! 'mBcGL2tnmiRujJdV/4fxrVd8E8wn6AW9IQKVcMv8tvOc7i5dOzZ39rpBKLuT
MRXDtMV1LyLiuKYb1pHj1IyeadEahcLYFfGygF4LG7Yzp4NWHtRzQ7Q8LXaJ
V7dXDboYCFkn2a8/Rtx1YSVh/sCONf5UoRC+MUIqrj4UiHN9r3s='
+1
View File
@@ -1,3 +1,4 @@
source "http://rubygems.org"
gem "rake"
gem "aws-sdk"
+5
View File
@@ -1,10 +1,15 @@
GEM
remote: http://rubygems.org/
specs:
aws-sdk (1.10.0)
json (~> 1.4)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
rake (10.0.3)
PLATFORMS
ruby
DEPENDENCIES
aws-sdk
rake
+13 -1
View File
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/wycats/handlebars.js.png?branch=master)](https://travis-ci.org/wycats/handlebars.js)
Handlebars.js
=============
@@ -11,13 +12,23 @@ keep the view and the code separated like we all know they should be.
Checkout the official Handlebars docs site at
[http://www.handlebarsjs.com](http://www.handlebarsjs.com).
Installing
----------
Installing Handlebars is easy. Simply download the package [from the
official site](http://handlebarsjs.com/) and add it to your web pages
(you should usually use the most recent version).
Alternatively, if you prefer having the latest version of handlebars from
the 'master' branch, passing builds of the 'master' branch are automatically
published to S3. You may download the latest passing master build by grabbing
a `handlebars-latest.js` file from the [builds page][builds-page]. When the
build is published, it is also available as a `handlebars-gitSHA.js` file on
the builds page if you need a version to refer to others.
`handlebars-runtime.js` builds are also available.
**Note**: The S3 builds page is provided as a convenience for the community,
but you should not use it for hosting Handlebars in production.
Usage
-----
In general, the syntax of Handlebars.js templates is a superset
@@ -382,3 +393,4 @@ License
-------
Handlebars.js is released under the MIT license.
[builds-page]: http://builds.handlebarsjs.com.s3.amazonaws.com/index.html
+26
View File
@@ -128,3 +128,29 @@ task :bench => "vendor" do
system "node bench/handlebars.js"
end
task :publish do
access_key_id = ENV['S3_ACCESS_KEY_ID']
secret_access_key = ENV['S3_SECRET_ACCESS_KEY']
bucket_name = ENV['S3_BUCKET_NAME']
rev = `git rev-list HEAD -n 1`.to_s.strip
master_rev = `git rev-list origin/master -n 1`.to_s.strip
upload = true if rev == master_rev
upload = upload && access_key_id && secret_access_key && bucket_name
if upload
require 'aws-sdk'
root = File.expand_path(File.dirname(__FILE__)) + '/dist/'
s3 = AWS::S3.new(access_key_id: access_key_id,secret_access_key: secret_access_key)
bucket = s3.buckets[bucket_name]
files = ['handlebars.js', 'handlebars.runtime.js'].map { |file| root + file }
files.each do |file|
basename = Pathname.new(file).basename.sub_ext('')
s3_objs = ["#{basename}-latest.js", "#{basename}-#{rev}.js"].map do |file|
bucket.objects[file]
end
s3_objs.each { |obj| obj.write(Pathname.new(file)) }
end
else
puts "Not uploading any files to S3!"
end
end