Permalink
Browse files

Merge branch 'master' of git://github.com/heroku/heroku-buildpack-rub…

…y into update
  • Loading branch information...
2 parents ea6763a + 32a84d8 commit 0a0798e6036a04bfea66a16987aece8850c0d794 @DouweM DouweM committed Feb 5, 2013
Showing with 109 additions and 17 deletions.
  1. +62 −0 CHANGELOG.md
  2. +3 −3 README.md
  3. +3 −2 Rakefile
  4. +1 −1 lib/language_pack.rb
  5. +1 −2 lib/language_pack/base.rb
  6. +17 −0 lib/language_pack/disable_deploys.rb
  7. +1 −1 lib/language_pack/rails3.rb
  8. +21 −8 lib/language_pack/ruby.rb
View
@@ -1,3 +1,65 @@
+## v50
+
+Features:
+
+* Restore ruby deploys back to normal
+
+## v49 (1/30/2013)
+
+Features:
+
+* Re-enable ruby deploys for apps just using the heroku cache
+* Display ruby version change when busting the cache
+
+## v48 (1/30/2013)
+
+Features:
+
+* Update deploy error message copy to link to status incident.
+
+## v47 (1/30/2013)
+
+Features:
+
+* Disable ruby deploys due to rubygems.org compromise
+
+## v46 (1/10/2013)
+
+Features:
+
+* Upgrade Bundler to 1.3.0.pre.5
+* bundler binstubs now go in vendor/bundle/bin
+
+## 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:
View
@@ -13,7 +13,7 @@ Example Usage:
$ ls
Gemfile Gemfile.lock
- $ heroku create --stack cedar --buildpack http://github.com/heroku/heroku-buildpack-ruby.git
+ $ heroku create --stack cedar --buildpack https://github.com/heroku/heroku-buildpack-ruby.git
$ git push heroku master
...
@@ -47,7 +47,7 @@ Example Usage:
$ ls config/environment.rb
config/environment.rb
- $ heroku create --stack cedar --buildpack http://github.com/heroku/heroku-buildpack-ruby.git
+ $ heroku create --stack cedar --buildpack https://github.com/heroku/heroku-buildpack-ruby.git
$ git push heroku master
...
@@ -81,7 +81,7 @@ Example Usage:
$ ls config/application.rb
config/application.rb
- $ heroku create --stack cedar --buildpack http://github.com/heroku/heroku-buildpack-ruby.git
+ $ heroku create --stack cedar --buildpack https://github.com/heroku/heroku-buildpack-ruby.git
$ git push heroku master
-----> Heroku receiving push
View
@@ -54,6 +54,7 @@ def install_gem(gem, version)
end
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_dir} /tmp",
@@ -65,7 +66,7 @@ def build_ruby_command(name, output, prefix, usr_dir, tmpdir, rubygems = nil)
build_command << "mv #{prefix} /app/vendor/#{output}" if prefix != "/app/vendor/#{output}"
build_command = build_command.join(" && ")
- sh "vulcan build -v -o #{output}.tgz --prefix #{prefix} --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
@@ -178,7 +179,7 @@ task "ruby:install", :version do |t, args|
# build ruby
if major_ruby == "1.8"
output = "ruby-build-#{version}"
- prefix = "/app/vendor/ruby-build-#{version}"
+ prefix = "/tmp/ruby-#{version}"
build_ruby_command(full_name, output, prefix, usr_dir, tmpdir, rubygems)
end
end
@@ -22,4 +22,4 @@ def self.detect(*args)
require "language_pack/rack"
require "language_pack/rails2"
require "language_pack/rails3"
-
+require "language_pack/disable_deploys"
@@ -62,7 +62,6 @@ def release
{
"addons" => default_addons,
- "config_vars" => default_config_vars,
"default_process_types" => default_process_types
}.to_yaml
end
@@ -153,7 +152,7 @@ def run_stdout(command)
%x{ #{command} 2>/dev/null }
end
- # run a shell command and stream the ouput
+ # run a shell command and stream the output
# @param [String] command to be run
def pipe(command)
output = ""
@@ -0,0 +1,17 @@
+require "language_pack"
+require "language_pack/base"
+
+class LanguagePack::DisableDeploys < LanguagePack::Base
+ def self.use?
+ File.exist?("Gemfile")
+ end
+
+ def name
+ "Ruby/DisableDeploys"
+ end
+
+ def compile
+ error "Ruby deploys have been temporarily disabled due to a Rubygems.org security breach.\nPlease see https://status.heroku.com/incidents/489 for more info and a workaround if you need to deploy."
+ end
+end
+
@@ -8,7 +8,7 @@ class LanguagePack::Rails3 < LanguagePack::Rails2
def self.use?
super &&
File.exists?("config/application.rb") &&
- File.read("config/application.rb") =~ /Rails::Application/
+ File.read("config/application.rb").include?("Rails::Application")
end
def name
@@ -5,10 +5,10 @@
# base Ruby Language Pack. This is for any base ruby app.
class LanguagePack::Ruby < LanguagePack::Base
- BUILDPACK_VERSION = "v40"
+ BUILDPACK_VERSION = "v50"
LIBYAML_VERSION = "0.1.4"
LIBYAML_PATH = "libyaml-#{LIBYAML_VERSION}"
- BUNDLER_VERSION = "1.2.1"
+ BUNDLER_VERSION = "1.3.0.pre.5"
BUNDLER_GEM_PATH = "bundler-#{BUNDLER_VERSION}"
NODE_VERSION = "0.4.7"
NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
@@ -141,7 +141,7 @@ def bootstrap_bundler(&block)
# determine if we're using rbx
# @return [Boolean] true if we are and false if we aren't
def ruby_version_rbx?
- ruby_version ? ruby_version.match(/^rbx-/) : false
+ ruby_version ? ruby_version.match(/rbx-/) : false
end
# determine if we're using jruby
@@ -159,7 +159,7 @@ def default_java_opts
# default JRUBY_OPTS
# return [String] string of JRUBY_OPTS
def default_jruby_opts
- "-Xcompile.invokedynamic=false"
+ "-Xcompile.invokedynamic=true"
end
# list the available valid ruby versions
@@ -191,7 +191,7 @@ def setup_language_pack_environment
# sets up the profile.d script for this buildpack
def setup_profiled
- set_env_default "GEM_PATH", "$HOME/#{slug_vendor_base}"
+ set_env_override "GEM_PATH", "$HOME/#{slug_vendor_base}:$GEM_PATH"
set_env_default "LANG", "en_US.UTF-8"
set_env_override "PATH", "$HOME/bin:$HOME/#{slug_vendor_base}/bin:$PATH"
@@ -204,7 +204,7 @@ def setup_profiled
# determines if a build ruby is required
# @return [Boolean] true if a build ruby is required
def build_ruby?
- @build_ruby ||= !ruby_version_jruby? && ruby_version != "ruby-1.9.3"
+ @build_ruby ||= !ruby_version_rbx? && !ruby_version_jruby? && !%w{ruby-1.9.3 ruby-2.0.0}.include?(ruby_version)
end
# install the vendored ruby
@@ -362,13 +362,17 @@ def remove_vendor_bundle
def build_bundler
log("bundle") do
bundle_without = ENV["BUNDLE_WITHOUT"] || "development:test"
- bundle_command = "bundle install --without #{bundle_without} --path vendor/bundle --binstubs bin/"
+ bundle_command = "bundle install --without #{bundle_without} --path vendor/bundle --binstubs vendor/bundle/bin"
unless File.exist?("Gemfile.lock")
error "Gemfile.lock is required. Please run \"bundle install\" locally\nand commit your Gemfile.lock."
end
if has_windows_gemfile_lock?
+ topic "WARNING: Removing `Gemfile.lock` because it was generated on Windows."
+ puts "Bundler will do a full resolve so native gems are handled properly."
+ puts "This may result in unexpected gem versions being used in your app."
+
log("bundle", "has_windows_gemfile_lock")
File.unlink("Gemfile.lock")
else
@@ -408,6 +412,13 @@ def build_bundler
# Keep gem cache out of the slug
FileUtils.rm_rf("#{slug_vendor_base}/cache")
+
+ # symlink binstubs
+ bin_dir = "bin"
+ FileUtils.mkdir_p bin_dir
+ Dir["#{slug_vendor_base}/bin/*"].each do |bin|
+ run("ln -s ../#{bin} #{bin_dir}") unless File.exist?("#{bin_dir}/#{bin}")
+ end
else
log "bundle", :status => "failure"
error_message = "Failed to install gems via Bundler."
@@ -597,8 +608,10 @@ def load_bundler_cache
elsif !File.exists?(buildpack_version_cache) && File.exists?(ruby_version_cache)
puts "Broken cache detected. Purging build cache."
purge_bundler_cache
- elsif cache_exists?(bundler_cache) && !(File.exists?(ruby_version_cache) && full_ruby_version == File.read(ruby_version_cache).chomp)
+ elsif cache_exists?(bundler_cache) && File.exists?(ruby_version_cache) && full_ruby_version != File.read(ruby_version_cache).chomp
puts "Ruby version change detected. Clearing bundler cache."
+ puts "Old: #{File.read(ruby_version_cache).chomp}"
+ puts "New: #{full_ruby_version}"
purge_bundler_cache
end

0 comments on commit 0a0798e

Please sign in to comment.