# Set the base dir to the parent dir because by convention the deploy.rb file is always located in the same place BASEDIR = File.expand_path(File.join(File.dirname(__FILE__), "..")) # name of the application set :application, "app1" # do not use version control set :scm, :none # path to deploy to. set :deploy_to, "/var/www/#{application}" # set to a custom rsync strategy that has been put in capistrano lib. set :deploy_via, :rsync_with_remote_cache # set user to use with rsync set :user, "app1" # The path to the local files which is to be deployed set :local_cache, "#{BASEDIR}/current" # Rsync options set :rsync_options, '-h -O -aiz --delete --delete-after --exclude=.svn --exclude=*.fla --exclude=assets/fla --delete-excluded' # setting a defualt role and all the servers to deploy to role :app, "app-server" # making sure that all the default rails-tasks are not activated namespace :deploy do [:setup, :start, :stop, :restart, :finalize_update, :migrate, :migrations].each do |default_task| task default_task do logger.trace "Doing nothing in task #{default_task}" end end end # # Keep 5 old releases (affects deploy:cleanup) set :keep_releases, 5 # # No need to use sudo, the permissions should be correct. set :use_sudo, false # Loading extra files in the same dir with the exception of this file. Dir[BASEDIR + '/config/*.rb'].each { |f| if File.basename(f, ".rb") != "deploy" load(f) end }