Automated Deployment

Managing large development and production environments is a long and complex process. At a startup where developers want to deploy multiple times a day managing certificates, building libraries and deploying thousands of lines of code from one environment to another manually can be time consuming and error prone.

 

Worst of all (*my heart is sinking just writing this*) it can cause downtime, which at a company like Haptik, where we provide service 24/7 is not acceptable.

 

To reduce risk and time of deployment, automation plays a very important role. We use a lot of cool tools to help automate our deployment processes.

 

  • git: (https://github.com/)
    Unlike the meaning of the word (noun: an unpleasant or contemptible person), git is and should be every engineer’s best friend. Git is a code management and version control system which allows multiple people to work on the same code base at the same time. We use github to host all our repositories.
  • Ansible (http://www.ansible.com/)
    Ansible is any DevOp person’s right hand. Ansible is a config and deployment management tool written in Python. Since Haptik is a python shop on the backend, Ansible fits right in. We use Ansible to setup the servers, make sure certificates and configs are set right and deploy code from github to all the different servers required. You can build some really complex flows with just a few lines of code in Ansible.

  • Fastlane (https://fastlane.tools/)
    Fastlane is an awesome tool used for both iOS and Android Continuous Deployment. It helps you build custom pipelines for different environments along with integrating all third party services like gradle, cocopods, crashlytics etc.
    Disclaimer: We don’t use fastlane as efficiently as we would like to, but we are working on that.

  • Rundeck (http://rundeck.org/)
    Say what you may but developers hate typing more than what is required. That’s where Rundeck comes in. Rundeck helps with runbook automations and by using Rundeck you can allow developers to deploy at the click of a button. It’s got a nice admin interface which makes deployments look a little less tedious than they already are.

  • Slacktree (https://github.com/course-hero/slacktee)
    Slacktree is a command line tool for Slack integration. We use Slacktree to inform the whole team about the progress of the deployments.

    p.s: If you don’t use Slack at your company, use it right now. It will change the way your company works. So, to sum it up our final pipeline for the backend looks something like this:
  1. Start release: Rundeck
  2. Update the team about a new release starting: Slacktree
  3. Take server out of LB: Ansible
  4. Setup / update environment and settle certificates: Ansible
  5. Clone the repository on the servers: Ansible
  6. Restart services: Ansible
  7. Bring server back into LB: Ansible
  8. Repeat for all different servers
  9. Update team the release is completed: Slacktree
  10.  

Our mobile pipeline looks similar except we use Fastlane for a lot of the automation in the middle.

 

Using the above pipeline we take about 5 minutes to complete the releases on 12 servers and have had 0 downtime during the release. Our deployment needs improvements and as next steps we plan on integrating Jenkins and automated tests as part of the pipeline.

 

What do you think about our pipeline? We would love to hear your feedback/suggestions in the comments below.

 

And if you don’t what the hell Haptik is, and why automating deployment can be extremely helpful. Check the app out here.

 

Wish to be a part of the amazing things we build? Look no further! Reach out to us at hello@haptik.co

Related Articles

View All