Skip to content

Instantly share code, notes, and snippets.

@BJClark
Created July 1, 2009 21:52
Show Gist options
  • Save BJClark/139096 to your computer and use it in GitHub Desktop.
Save BJClark/139096 to your computer and use it in GitHub Desktop.
task :deploy, :roles => :live_web do
set(:deploy_tag) do
Capistrano::CLI.ui.ask "Tag to deploy to: "
end
die 'Tag must be longer than 4 characters' unless deploy_tag.length > 4
`cd #{RAILS_ROOT} && ruby vendor/plugins/newrelic_rpm/bin/newrelic_cmd deployments -e production -r #{deploy_tag}`
do_deploy
end
serial_task :do_deploy, :roles => :live_web do
. . .
checkout(deploy_tag)
. . .
end
def checkout(tag)
run "cd #{COMPOSTUS_DIR}; git fetch", &git_stream_handler(self)
run "cd #{COMPOSTUS_DIR}; git checkout #{tag};", &git_stream_handler(self)
end
(git_stream_handler isn't necessary anymore, but we haven't removed it yet.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment