Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[close #797] Do not carry asset pipeline fragment cache into runtime #812

Merged
merged 4 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Master

* Delete the sprockets temp directory for a smaller runtime slug if they are not building assets at runtime (https://github.com/heroku/heroku-buildpack-ruby/pull/812)

## v195 (10/18/2018)

* Default Ruby version is now 2.4.5 (https://github.com/heroku/heroku-buildpack-ruby/pull/821)
Expand Down
3 changes: 3 additions & 0 deletions hatchet.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
"sharpstone/active_storage_local",
"sharpstone/sprockets_asset_compile_true"
],
"heroku": [
"heroku/ruby-getting-started"
],
"multibuildpack": [
"sharpstone/node_multi"
],
Expand Down
2 changes: 2 additions & 0 deletions hatchet.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
- 540ec776eff3111ad9bb01af204c62725c94a11d
- - "./repos/ci/ruby_no_rails_test"
- 3916137106d59b008b67d738abe6a1438f8fbde6
- - "./repos/heroku/ruby-getting-started"
- 7abd8af85c7ba6486bb03a4964da9cea98766b06
- - "./repos/jruby/jruby_naether"
- c5081c07de64dcd4b480923e4b7e2a98a9b4a431
- - "./repos/multibuildpack/node_multi"
Expand Down
7 changes: 7 additions & 0 deletions lib/language_pack/rails4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def default_assets_cache
"tmp/cache/assets"
end

def cleanup
super
return if assets_compile_enabled?
return unless Dir.exist?(default_assets_cache)
FileUtils.remove_dir(default_assets_cache)
end

def run_assets_precompile_rake_task
instrument "rails4.run_assets_precompile_rake_task" do
log("assets_precompile") do
Expand Down
4 changes: 4 additions & 0 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ def compile
end
config_detect
best_practice_warnings
cleanup
super
end
end

def cleanup
end

def config_detect
end

Expand Down
9 changes: 9 additions & 0 deletions spec/hatchet/getting_started_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require_relative '../spec_helper'

describe "Heroku ruby getting started" do
it "clears runtime cache" do
Hatchet::Runner.new("ruby-getting-started").deploy do |app|
expect(app.run("ls tmp/cache/assets")).to_not match("sprockets")
end
end
end