Created
July 30, 2018 11:45
-
-
Save benwalsh/2e397a84f6dc1df0ca72a196ca9d1bd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :assets_roles, :assets | |
after :compile_assets, :copy_manifest | |
task :copy_manifest do | |
on roles(:assets) do | |
within(shared_path) do | |
set(:manifest_path, capture(:ls, '-t', 'public/assets/.sprockets-*.json', '|', 'head', '-n1')) | |
set(:manifest_filename, fetch(:manifest_path).split('/').last) | |
download!(fetch(:manifest_path), "tmp/#{fetch(:manifest_filename)}") | |
end | |
end | |
on roles(:all) do | |
within(shared_path) do | |
execute(:rm, '-f', 'public/assets/.sprockets-*.json') | |
upload!("tmp/#{fetch(:manifest_filename)}", fetch(:manifest_path)) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment