Permalink
Browse files

Update base Ruby buildpack to v45

Merge remote-tracking branch 'heroku/master'

Conflicts:
	CHANGELOG.md
	README.md
  • Loading branch information...
2 parents 302488c + b2cd9df commit ca3530f8b470263b75fc11ba4a9c2e32e2330f10 @indirect committed Dec 31, 2012
Showing with 464 additions and 77 deletions.
  1. +149 −1 CHANGELOG.md
  2. +1 −4 README.md
  3. +64 −40 Rakefile
  4. +3 −0 bin/compile
  5. +29 −2 lib/language_pack/base.rb
  6. +8 −0 lib/language_pack/rack.rb
  7. +8 −1 lib/language_pack/rails2.rb
  8. +3 −3 lib/language_pack/rails3.rb
  9. +199 −26 lib/language_pack/ruby.rb
View
@@ -2,7 +2,155 @@
* builds middleman sites for static hosting on Heroku
-# jekyll
+## v45 (12/14/2012)
+
+Features:
+
+* Stop setting env vars in bin/release now that login-shell is released
+* Enable Invoke Dynamic on JRuby by default
+* GEM_PATH is now updated on each push
+
+## v44 (12/14/2012)
+
+Faulty Release
+
+## v43 (12/13/2012)
+
+Features:
+
+* Upgrade Bundler to 1.3.0.pre.2
+
+## v42 (11/26/2012)
+
+Features:
+
+* Upgrade Bundler to 1.2.2 to fix Ruby 2.0.0/YAML issues
+
+## v41 (11/1/2012)
+
+Features:
+
+* Enable ruby 2.0.0 support for testing
+
+## v40 (10/14/2012)
+
+Features:
+
+* Cache version of the buildpack we used to deploy
+* Purge cache when v38 is detected
+
+## v39 (10/14/2012)
+
+Bugfixes:
+
+* Don't display cache clearing message for new apps
+* Actually clear bundler cache on ruby version change
+
+## v38 (10/14/2012)
+
+Bugfixes:
+
+* Stop bundle cache from continually growing
+
+## v37 (10/12/2012)
+
+Bugfixes:
+
+* Remove temporary workaround from v36.
+* Clear bundler cache upon Ruby version change
+
+## v36 (10/12/2012)
+
+Bugfixes:
+
+* Always clear the cache for ruby 1.9.3 as a temporary workaround due to the security upgrade
+
+## v35 (9/19/2012)
+
+Features:
+
+* Upgrade to Bundler 1.2.1
+* Display bundle clean output
+* More resilent to rubygems.org API outages
+
+Bugfixes:
+
+* `bundle clean` works again
+
+## v34 (8/30/2012)
+
+Features:
+
+* Upgrade to Bundler 1.2.0
+
+## v33 (8/9/2012)
+
+Features:
+
+* Upgrade to Bundler 1.2.0.rc.2
+* vendor JDK7 for JRuby, but disable invoke dynamic
+
+## v29 (7/19/2012)
+
+Features:
+
+* support .profile.d/ruby.sh
+* sync stdout so that the buildpack streams even in non-interactive shells
+* Upgrade to Bundler 1.2.0.rc
+
+## v28 (7/16/2012)
+
+Features:
+
+* Vendor OpenJDK6 into slug when using JRuby
+* ruby version support for ruby 1.8.7 via bundler's ruby DSL
+
+Bugfixes:
+
+* sqlite3 error gets displayed again
+
+## v27 (6/14/2012)
+
+Bugfixes:
+
+* Remove `vendor/bundle` message only appears when dir actually exists
+
+## v26 (6/14/2012)
+
+Features:
+
+* print message when assets:precompile finishes successfully
+* Remove `vendor/bundle` if user commits it to their git repo.
+
+## v25 (6/12/2012)
+
+Features:
+
+* support "ruby-xxx-jruby-yyy" for jruby detection packages
+
+## v24 (6/7/2012)
+
+Features:
+
+* removes bundler cache in the slug, to minimize slug size (@stevenh512, #16)
+* optimize push time with caching
+
+## v23 (5/8/2012)
+
+Bugfixes:
+
+* fix ruby version bug with "fatal:-Not-a-git-repository"
+
+## v22 (5/7/2012)
+
+Features:
+
+* bundler 1.2.0.pre
+* ruby version support for ruby 1.9.2/1.9.3 via bundler's ruby DSL
+
+Deprecation:
+
+* ENV['RUBY_VERSION'] in favor of bundler's ruby DSL
## v21 (3/21/2012)
View
@@ -6,9 +6,6 @@ This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) fo
Usage
-----
- $ git clone http://github.com/indirect/middleman-heroku-app.git mysite
- $ cd mysite
- $ heroku create --stack cedar --buildpack http://github.com/indirect/heroku-buildpack-middleman.git
$ git push heroku master
Hacking
@@ -36,4 +33,4 @@ Rack (config.ru is detected)
Middleman
* runs `middleman build` to build the static version of your site
-* serves your static site via Rack::Static
+* serves your static site via Rack::Static
View
104 Rakefile
@@ -12,13 +12,14 @@ def s3_upload(tmpdir, name)
sh("#{s3_tools_dir}/s3 put #{S3_BUCKET_NAME} #{name}.tgz #{tmpdir}/#{name}.tgz")
end
-def vendor_plugin(git_url)
+def vendor_plugin(git_url, branch = nil)
name = File.basename(git_url, File.extname(git_url))
Dir.mktmpdir("#{name}-") do |tmpdir|
FileUtils.rm_rf("#{tmpdir}/*")
Dir.chdir(tmpdir) do
sh "git clone #{git_url} ."
+ sh "git checkout origin/#{branch}" if branch
FileUtils.rm_rf("#{name}/.git")
sh("tar czvf #{tmpdir}/#{name}.tgz *")
s3_upload(tmpdir, name)
@@ -52,18 +53,20 @@ def install_gem(gem, version)
end
end
-def build_ruby_command(name, output, prefix, usr_dir, tmpdir)
+def build_ruby_command(name, output, prefix, usr_dir, tmpdir, rubygems = nil)
+ vulcan_prefix = "/app/vendor/#{output}"
build_command = [
# need to move libyaml/libffi to dirs we can see
- "mv usr /tmp",
- "./configure --disable-install-doc --prefix #{prefix}",
+ "mv #{usr_dir} /tmp",
+ "./configure --enable-load-relative --disable-install-doc --prefix #{prefix}",
"env CPATH=/tmp/#{usr_dir}/include:\\$CPATH CPPATH=/tmp/#{usr_dir}/include:\\$CPPATH LIBRARY_PATH=/tmp/#{usr_dir}/lib:\\$LIBRARY_PATH make",
"make install"
]
- build_command << "mv #{prefix} /app/vendor/#{name}" if name != output
+ build_command << "#{prefix}/bin/ruby /tmp/#{usr_dir}/rubygems-#{rubygems}/setup.rb" if rubygems
+ build_command << "mv #{prefix} /app/vendor/#{output}" if prefix != "/app/vendor/#{output}"
build_command = build_command.join(" && ")
- sh "vulcan build -v -o #{output}.tgz --source #{name} --command=\"#{build_command}\""
+ sh "vulcan build -v -o #{output}.tgz --prefix #{vulcan_prefix} --source #{name} --command=\"#{build_command}\""
s3_upload(tmpdir, output)
end
@@ -84,7 +87,7 @@ end
desc "update plugins"
task "plugins:update" do
- vendor_plugin "http://github.com/ddollar/rails_log_stdout.git"
+ vendor_plugin "http://github.com/heroku/rails_log_stdout.git", "legacy"
vendor_plugin "http://github.com/pedro/rails3_serve_static_assets.git"
vendor_plugin "http://github.com/hone/rails31_enable_runtime_asset_compilation.git"
end
@@ -104,16 +107,17 @@ task "libyaml:install", :version do |t, args|
Dir.mktmpdir("libyaml-") do |tmpdir|
Dir.chdir(tmpdir) do |dir|
FileUtils.rm_rf("#{tmpdir}/*")
+ prefix = "/app/vendor/yaml-#{version}"
sh "curl http://pyyaml.org/download/libyaml/yaml-#{version}.tar.gz -s -o - | tar vzxf -"
build_command = [
- "env CFLAGS=-fPIC ./configure --enable-static --disable-shared --prefix=/app/vendor/yaml-#{version}",
+ "env CFLAGS=-fPIC ./configure --enable-static --disable-shared --prefix=#{prefix}",
"make",
"make install"
].join(" && ")
- sh "vulcan build -v -o #{name}.tgz --source yaml-#{version} --command=\"#{build_command}\""
+ sh "vulcan build -v -o #{name}.tgz --source yaml-#{version} --prefix=#{prefix} --command=\"#{build_command}\""
s3_upload(tmpdir, name)
end
end
@@ -148,28 +152,36 @@ end
desc "install ruby"
task "ruby:install", :version do |t, args|
- version = args[:version]
- name = "ruby-#{version}"
- usr_dir = "usr"
+ full_version = args[:version]
+ full_name = "ruby-#{full_version}"
+ version = full_version.split('-').first
+ name = "ruby-#{version}"
+ usr_dir = "usr"
+ rubygems = nil
Dir.mktmpdir("ruby-") do |tmpdir|
Dir.chdir(tmpdir) do |dir|
FileUtils.rm_rf("#{tmpdir}/*")
- sh "curl http://ftp.ruby-lang.org/pub/ruby/1.9/#{name}.tar.gz -s -o - | tar vzxf -"
- FileUtils.mkdir_p("#{name}/#{usr_dir}")
- Dir.chdir("#{name}/#{usr_dir}") do
- sh "curl #{VENDOR_URL}/libyaml-0.1.4.tgz -s -o - | tar vzxf -"
- sh "curl #{VENDOR_URL}/libffi-3.0.10.tgz -s -o - | tar vzxf -"
+ major_ruby = version.match(/\d\.\d/)[0]
+ rubygems = "1.8.24" if major_ruby == "1.8"
+ sh "curl http://ftp.ruby-lang.org/pub/ruby/#{major_ruby}/#{full_name}.tar.gz -s -o - | tar zxf -"
+ FileUtils.mkdir_p("#{full_name}/#{usr_dir}")
+ Dir.chdir("#{full_name}/#{usr_dir}") do
+ sh "curl #{VENDOR_URL}/libyaml-0.1.4.tgz -s -o - | tar zxf -"
+ sh "curl #{VENDOR_URL}/libffi-3.0.10.tgz -s -o - | tar zxf -"
+ sh "curl http://production.cf.rubygems.org/rubygems/rubygems-#{rubygems}.tgz -s -o - | tar xzf -" if major_ruby == "1.8"
end
# runtime ruby
prefix = "/app/vendor/#{name}"
- build_ruby_command(name, name, prefix, usr_dir, tmpdir)
+ build_ruby_command(full_name, name, prefix, usr_dir, tmpdir, rubygems)
# build ruby
- output = "ruby-build-#{version}"
- prefix = "/tmp/#{name}"
- build_ruby_command(name, output, prefix, usr_dir, tmpdir)
+ if major_ruby == "1.8"
+ output = "ruby-build-#{version}"
+ prefix = "/tmp/ruby-#{version}"
+ build_ruby_command(full_name, output, prefix, usr_dir, tmpdir, rubygems)
+ end
end
end
end
@@ -229,30 +241,42 @@ task "rbx2dev:install", :version, :ruby_version do |t, args|
end
desc "install jruby"
-task "jruby:install", :version do |t, args|
- version = args[:version]
- name = "jruby-bin-#{version}"
- output = "jruby-#{version}"
- launcher = "launcher"
+task "jruby:install", :version, :ruby_version do |t, args|
+ version = args[:version]
+ ruby_version = args[:ruby_version]
+ name = "jruby-src-#{version}"
+ src_folder = "jruby-#{version}"
+ output = "ruby-#{ruby_version}-jruby-#{version}"
+ launcher = "launcher"
Dir.mktmpdir("jruby-") do |tmpdir|
Dir.chdir(tmpdir) do
sh "curl http://jruby.org.s3.amazonaws.com/downloads/#{version}/#{name}.tar.gz -s -o - | tar vzxf -"
- Dir.chdir("#{output}/bin") do
- sh "curl #{VENDOR_URL}/jruby-launcher-1.0.12-java.tgz -s -o - | tar vzxf -"
+ sh "rm -rf test"
+ Dir.chdir(src_folder) do
+ sh "curl http://www.nic.funet.fi/pub/mirrors/apache.org/ant/binaries/apache-ant-1.8.4-bin.tar.gz -s -o - | tar vxzf -"
+ sh "rm -rf manual"
end
- sh "rm #{output}/bin/*.bat"
- sh "rm #{output}/bin/*.dll"
- sh "rm #{output}/bin/*.exe"
- sh "rm -rf #{output}/docs"
- sh "rm -rf #{output}/samples"
- sh "rm -rf #{output}/share"
- sh "rm -rf #{output}/tool"
- sh "ln -s jruby #{output}/bin/ruby"
- Dir.chdir(output) do
- sh("tar czvf #{tmpdir}/#{output}.tgz *")
- s3_upload(tmpdir, output)
+ Dir.chdir("#{src_folder}/bin") do
+ sh "curl #{VENDOR_URL}/jruby-launcher-1.0.12-java.tgz -s -o - | tar vzxf -"
end
+
+ major, minor, patch = ruby_version.split('.')
+
+ build_command = [
+ "apache-ant-1.8.4/bin/ant -Djruby.default.ruby.version=#{major}.#{minor}",
+ "rm bin/*.bat",
+ "rm bin/*.dll",
+ "rm bin/*.exe",
+ "ln -s jruby bin/ruby",
+ "mkdir -p /app/vendor/#{output}",
+ "mv bin /app/vendor/#{output}",
+ "mv lib /app/vendor/#{output}"
+ ]
+ build_command = build_command.join(" && ")
+ sh "vulcan build -v -o #{output}.tgz --prefix /app/vendor/#{output} --source #{src_folder} --command=\"#{build_command}\""
+
+ s3_upload(tmpdir, output)
end
end
end
@@ -315,7 +339,7 @@ task "libffi:install", :version do |t, args|
"rm -rf #{prefix}/lib/#{name}"
].join(" && ")
- sh "vulcan build -v -o #{name}.tgz --source #{name} --command=\"#{build_command}\""
+ sh "vulcan build -v -o #{name}.tgz --source #{name} --prefix=#{prefix} --command=\"#{build_command}\""
s3_upload(tmpdir, name)
end
end
View
@@ -1,5 +1,8 @@
#!/usr/bin/env ruby
+# sync output
+$stdout.sync = true
+
$:.unshift File.expand_path("../../lib", __FILE__)
require "language_pack"
Oops, something went wrong.

0 comments on commit ca3530f

Please sign in to comment.