Posted 3 months ago. Visible to the public.

Capistrano: Finding out who deployed which revision of your application and when

Capistrano automatically logs each (successful) deployment into a file on your application servers.

It is located at the root of your server's project folder, i.e. the parent of releases and current, like so:

Copy
/var/www/your-project$ ls current log releases repo revisions.log <--- here shared

Each line in that file contains the deployed branch, commit, release ID, and username (was read from the deploying user's machine):

Copy
$ tail -n3 revisions.log Branch master (at da45511bea63002ac2ff002d1692e09d0dd7cb88) deployed as release 20190716082309 by alice Branch master (at dc9c812d847f1322913149a4a5648d933b6aa73a) deployed as release 20190722141405 by bob Branch master (at 4bb4e2c23a3ed3c7e9c972a8416e109391461af0) deployed as release 20190722144129 by bob

Note that release IDs by default are a formatted deployment timestamp (yyyymmddHHMMSS), so as a bonus you will usually know when that release was deployed.
If your release IDs are different, you can try reading the directory's modification timestamp:

Copy
$ stat -c %y releases/0023 2019-07-22 16:43:11.877664481 +0200

FYI: If you are only interested in the currently deployed revision, we also have a card on this. It also contains a Capistrano task that can be called from developer machines.

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
Arne Hartherz
Last edit:
3 months ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more