Skip to content

Instantly share code, notes, and snippets.

@andrey-skat
Last active December 1, 2024 08:06
Show Gist options
  • Select an option

  • Save andrey-skat/10399224 to your computer and use it in GitHub Desktop.

Select an option

Save andrey-skat/10399224 to your computer and use it in GitHub Desktop.

Revisions

  1. andrey-skat revised this gist Apr 11, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion deploy.rb
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,8 @@

    within release_path do
    with rails_env: fetch(:rails_env) do
    execute :rm, "#{shared_path}/public/assets/manifest*"
    old_manifest_path = "#{shared_path}/public/assets/manifest*"
    execute :rm, old_manifest_path if test "[ -f #{old_manifest_path} ]"
    upload!('./public/assets/', "#{shared_path}/public/", recursive: true)
    end
    end
  2. andrey-skat revised this gist Apr 11, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions deploy.rb
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@

    within release_path do
    with rails_env: fetch(:rails_env) do
    execute :rm, "#{shared_path}/public/assets/manifest*"
    upload!('./public/assets/', "#{shared_path}/public/", recursive: true)
    end
    end
  3. andrey-skat revised this gist Apr 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deploy.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # also you need uncomment next line in Capfile
    # also you need to uncomment next line in Capfile
    # require 'capistrano/rails/assets'

    namespace :deploy do
  4. andrey-skat revised this gist Apr 10, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions deploy.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # also you need uncomment next line in Capfile
    # require 'capistrano/rails/assets'

    namespace :deploy do
    namespace :assets do

  5. andrey-skat created this gist Apr 10, 2014.
    26 changes: 26 additions & 0 deletions deploy.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    namespace :deploy do
    namespace :assets do

    Rake::Task['deploy:assets:precompile'].clear_actions

    desc 'Precompile assets locally and upload to servers'
    task :precompile do
    on roles(fetch(:assets_roles)) do
    run_locally do
    with rails_env: fetch(:rails_env) do
    execute 'bin/rake assets:precompile'
    end
    end

    within release_path do
    with rails_env: fetch(:rails_env) do
    upload!('./public/assets/', "#{shared_path}/public/", recursive: true)
    end
    end

    run_locally { execute 'rm -rf public/assets' }
    end
    end

    end
    end