Sha256: 276508254bf4a3d087c28c9a689bb95ad35d18a3415a8ffeab15439a2c113807

Contents?: true

Size: 1.21 KB

Versions: 14

Compression:

Stored size: 1.21 KB

Contents

# -*- encoding : utf-8 -*-

# from https://github.com/AF83/capistrano-af83/blob/master/lib/capistrano/af83/deploy/assets.rb
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)

namespace :deploy do
  namespace :assets do

    desc <<-DESC
      Run the asset precompilation rake task. You can specify the full path \
      to the rake executable by setting the rake variable. You can also \
      specify additional environment variables to pass to rake via the \
      asset_env variable. The defaults are:

        set :rake,      "rake"
        set :rails_env, "production"
        set :asset_env, "RAILS_GROUPS=assets"
        set :assets_dependencies, fetch(:assets_dependencies) + %w(config/locales/js)
    DESC
    task :precompile, :roles => :web, :except => { :no_release => true } do
      from = source.next_revision(current_revision)
      if capture("cd #{latest_release} && #{source.local.diff(from)} #{assets_dependencies.join ' '} | wc -l").to_i > 0
        run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
      else
        logger.info "Skipping asset pre-compilation because there were no asset changes"
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
bootstrappers-4.2.1.1 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.1 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.11 templates/capistrano/deploy/assets.rb
bootstrappers2-4.0 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.5 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.4 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.3 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.2 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0.1 templates/capistrano/deploy/assets.rb
bootstrappers-4.2.0 templates/capistrano/deploy/assets.rb
bootstrappers-4.0.rc1 templates/capistrano/deploy/assets.rb
bootstrappers-0.2.2 templates/capistrano/deploy/assets.rb
bootstrappers-0.2.1 templates/capistrano/deploy/assets.rb
bootstrappers-0.2.0.1 templates/capistrano/deploy/assets.rb