Once in a while you find great tools which not only make your life easier but also make programming fun again. Now in this case I am talking about capifony, which is an awesome tool for deploying your application on multiple servers using git.
What is capifony?
Capistrano is an open source tool for running scripts on multiple servers. It’s primary use is for easily deploying applications. While it was built specifically for deploying Rails apps, it’s pretty simple to customize it to deploy other types of applications.
capifony is a deployment recipes collection that works with both symfony and Symfony2 applications.
I hope that explain where it came from, capifony also offers two strategies for doing deployment.
- deployment → scm → production (Production server must have access to git repo)
- deployment → production (Plain copy of the code from your local to the remote production server)
In our case we going to use the first strategy, (deployment → scm → production). Please read the documentation on how to install capifony on your machine on their website. I will only share my script with you.
I create a small server(droplet) on my digital ocean account and performed the following steps:
- Added git access for my droplet server (using ssh keys)
- Added ssh password-less login for my local machine and the remote droplet server(More)
You will note I added multi version deployment which forces the script to keep the last 10 deployments on the droplet server.
NB: I have not tried this script on PRODUCTION yet and would recommend that you read up on the documentation some more until you understand every line on the script.
Thanks for reading, Bye.