How to log your deployments with codebase
I use codebase at work for hosting our projects using git. I discovered recently that I could also log every deployment I make with capifony on either our staging or production environment (or both).
It is quite straightforward to setup, and codebase explain every step to follow in their “Show Setup Instructions”:
Install codebase locally
Link your codebase account
Go to your “Deploys” page and find your token, then run
Log your deployment
prev_hash
is the commit hash the project was at before the deployment.current_has
is the commit hash you are deploying.domains
is a list of domains you are deploying to. Can be a comma list (www.domain.com,www.domain.co.uk,….).branch
is the branch you are deploying (usuallymaster
but hey - you could be deployingstaging
on a training environment).project
is your codebase permalink project (visible in the URL of your codebase project).
Automatically deploy with Capifony
I previously showed you how to use capifony and deploy your projects, it is now time to use capifony to log your deployment.
Add a custom task to your app/config/deploy.rb
as follow:
And now, after each cap:deploy
, custom:log:codebase
will be triggered and log the deployment on your codebase!
If everything goes well, you should see the list of your deployments in the “Deployments” tab of your projects:
a few deployments logged
P.S: Codebase offers a free plan which gives you one project, 100MB disk space and 2 users.