Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task :finalize_update, :except => { :no_release => true } do
- run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
- # mkdir -p is making sure that the directories are there for some SCM's that don't
- # save empty folders
- run <<-CMD
- rm -rf #{latest_release}/log #{latest_release}/public/system #{latest_release}/tmp/pids &&
- mkdir -p #{latest_release}/public &&
- mkdir -p #{latest_release}/tmp &&
- ln -s #{shared_path}/log #{latest_release}/log &&
- ln -s #{shared_path}/system #{latest_release}/public/system &&
- ln -s #{shared_path}/pids #{latest_release}/tmp/pids &&
- ln -sf #{shared_path}/database.yml #{latest_release}/config/database.yml
- CMD
- run "cd #{current_path} ; bundle install"
- if fetch(:normalize_asset_timestamps, true)
- stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
- asset_paths = fetch(:public_children, %w(images stylesheets javascripts)).map { |p| "#{latest_release}/public/#{p}" }.join(" ")
- run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
- end
- end
Add Comment
Please, Sign In to add comment