I am struggling with the idea of deploying a large app using the the asset pipeline and the precompile Capistrano task.
I don't want to install the javascript runtime environment and precompile the assets on each production server.
The assets need to be uploaded to two Nginx servers that don't have a copy of the app.
So I have created a Capistrano task that precompiles the assets locally and then uploads the assets to the the Nginx servers, and the manifest files to the app servers.
The problem is the assets on my local machine could differ from the assets the git branch I am deploying from.
Is there a better way or must I just be dillagent to always deploy from the correct clean branch?
Edit here is the cap task that does the precompile and upload
namespace :assets do
after "deploy:update_code", "assets:precompile"
after "assets:precompile", "assets:upload_assets"
after "assets:precompile", "assets:upload_manifest"
desc "precompile assets"
task :precompile do
run_locally("bundle exec rake assets:clean && bundle exec rake assets:precompile RAILS_ENV=#{rails_env}")
end
desc "precompile and upload assets to webserver"
task :upload_assets, :roles => :nginx do
top.upload( "public/assets", "/usr/local/fieldphone/#{rails_env}/", :via => :scp, :recursive => true)
end
#
desc "upload manifest file"
task :upload_manifest, :roles => :app do
top.upload( "public/manifest.yml", "#{release_path}/public/", :via => :scp )
end
end