WHY DEPLOYMENT AGAIN?
Git method of deployment requires upfront investment in coding of
hooks, which we have not have time for.
Finding the right pre-existing tool means we don't have to write the
deployment code ourselves.
There are other existing tried and tested methods.
WHAT IS CAPISTRANO?
Capistrano is a utility framework for executing commands in parallel on
multiple remote machines, via SSH. It uses a simple DSL (borrowed in part
from Rake) that allows you to deﬁne tasks, which may be applied to machines
in certain roles. It also supports tunneling connections via some gateway
machine to allow operations to be performed behind VPNs and ﬁrewalls.
- Via RubyDoc.info
It's a command line tool which runs via SSH that runs set tasks
deﬁned in a conﬁguration ﬁle, these tasks deﬁned are run when you
want to deploy an application.
WHAT ARE THE APPLICATIONS?
Using Capistrano, the code is uploaded to it's own folder, and your production
website can be deﬁned as a symbolic link to the latest release.
This can be useful in that if you ever need to regress your website to a
previous state it's just a matter of changing the symbolic link to that speciﬁc
version stored on the server, this means you don't need to upload everything
again. Which means quicker regressions.
You can run pretty much any CLI task, for example run composer to install
dependencies, run bower, set ﬁles to be executable, Change folder
HOW DIFFICULT IS IT TO SETUP?
The answer is not very, just need to get SSH access on your
machine that will be doing the deployment.
Then you just deﬁne your deployment tasks and you're ready to go.
CAPISTRANO VS GIT
Git will replace all ﬁles on the production server during deploy
directly to the production root, meaning some issues for users while
the deployment process is on going.
This problem is overcome by Capistrano by uploading everything
then setting the latest deployment folder as the production code.
Capistrano provides a precise syntax for deﬁning deployment tasks
Git does not, Capistrano was made speciﬁcally for deploying code.
Git allows you to do this via hooks, however you have to code it all
WHY IS IT IMPORTANT TO HAVE A
PROPER DEPLOYMENT PROCEDURE
Because it's the right way to work.
Having an automated release procedure means less error prone
Less tedious procedure for deployment.
Less manual access to server via FTP means more control and
documentation of production changes.