Posted over 1 year ago. Visible to the public.

Capistrano + Rails: Tagging production deploys

Just like Ruby Gems tag their version releases to the corresponding Git commit, it can be helpful to track production deploys within the commit history. This task does the tagging for you.

Capistrano 3

Copy
# lib/capistrano/tasks/deploy.rb namespace :deploy do ... desc 'Tag the deployed revision' task :tag_revision do date = Date.today.to_s puts `git tag deploy-#{date} #{fetch :current_revision}` puts `git push --tags origin` end end
Copy
# config/deploy/production.rb after 'deploy:finished', 'deploy:tag_revision'

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Dominik Schöler
Last edit:
over 1 year ago
by Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more