Continuous Deployment with CircleCI 1.x and Capistrano for web applications

Saving time by automating routine deployment tasks

Why do we need automation?

Continuous Deployment

CircleCI

Capistrano

Step by step configuration

Adding integration

And authorize it with Github.

Move to Dashboard and start building a project.

After first running, the tests will probably be passed. But for automated deployment we need to specify a task.

Configuration file

touch circle.yml

In my case, I have two tasks to deploy on two different stages — staging and production.

Now we can commit changes and push them to remote repository. When changes will be merged into staging or production, the branch commands specified in the circle.yml will be launched automatically after passing the tests.

Before creating staging/production branch we need to add an ssh key on the CircleCI project that enables us to connect to our node.

If you have an access to the node from your machine, just copy it:

cat ~/.ssh/id_rsa

Open project settings, select “SSH Permissions” tab and click on “Add SSH Key”.

Into an opened popup put a сopied ssh private key.

The last step is to create branches from which you’ll deploy to different stages. In my case, it’s a command:

cap production deploy

Deliver last changes to production stage right after the creation of the branch and tests passing.

Software Engineer. Interested in Full-Stack Development and DevOps.

Software Engineer. Interested in Full-Stack Development and DevOps.