set :application, "arp_website" set :repository, "git@iron.arpnetworks.com:arp_website.git" # If you aren't deploying to /u/apps/#{application} on the target # servers (which is the default), you can specify the actual location # via the :deploy_to variable: set :deploy_to, "/home/httpd/html/arpnetworks.com" set :deploy_env, "production" set :scm, :git set :git_shallow_clone, 1 # Deploy a branch other than master # ============================================================ # = these tasks are meant to be chained making deploy easier = # = cap staging deploy or cap production deploy = # ============================================================ # No staging server yet # # # Staging deploy task # task :staging do # set :branch, "origin/master" # set :top_level_task, "staging" # # role :app, "arpnetworks.com" # role :web, "arpnetworks.com" # role :db, "arpnetworks.com", :primary => true # end # Production deploy task task :production do set :branch, "origin/production" set :top_level_task, "production" role :app, "arpnetworks.com" role :web, "arpnetworks.com" role :db, "arpnetworks.com", :primary => true end # Forward authentication so we can access Git repo w/ our local keys set :ssh_options, :forward_agent => true namespace :deploy do task :restart do # No action required end end # Tag what we deploy after :deploy, 'git:tag' namespace :git do desc "Tag the head of :branch as a release and push to origin." task :tag, :roles => :app do timestamp = `date +%Y-%m-%d-%H%M%S`.chomp tag = "release/#{top_level_task}/#{timestamp}" deployed_branch = respond_to?(:branch) ? branch : 'HEAD' `git tag #{tag} #{deployed_branch} && git push origin refs/tags/#{tag}` end end