# Continuous Deployment System

DevFeed: [Continuous Deployment System](<https://devfeed.tech/articles/continuous-deployment-system-19982.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2013/08/05/continuous-deployment-system/>)

Published: 2013-08-05T00:00:00Z

Content type: article

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Continuous Deployment (CD)](<https://devfeed.tech/topics/continuous-deployment.md>), [Continuous Delivery (CD)](<https://devfeed.tech/topics/continuous-delivery.md>), [CI/CD Pipeline](<https://devfeed.tech/topics/ci-cd-pipeline.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Continuous integration](<https://devfeed.tech/topics/continuous-integration.md>)

Tags: [automated-deployment](<https://devfeed.tech/tags/automated-deployment.md>), [automated-testing](<https://devfeed.tech/tags/automated-testing.md>), [backend](<https://devfeed.tech/tags/backend.md>), [bitbucket](<https://devfeed.tech/tags/bitbucket.md>), [branch](<https://devfeed.tech/tags/branch.md>), [cds](<https://devfeed.tech/tags/cds.md>), [commits](<https://devfeed.tech/tags/commits.md>), [continuous-deployment](<https://devfeed.tech/tags/continuous-deployment.md>), [database](<https://devfeed.tech/tags/database.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [ec2](<https://devfeed.tech/tags/ec2.md>), [git](<https://devfeed.tech/tags/git.md>), [master](<https://devfeed.tech/tags/master.md>), [nosql](<https://devfeed.tech/tags/nosql.md>), [production](<https://devfeed.tech/tags/production.md>), [release](<https://devfeed.tech/tags/release.md>), [repository](<https://devfeed.tech/tags/repository.md>), [servers](<https://devfeed.tech/tags/servers.md>), [static](<https://devfeed.tech/tags/static.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

HackerEarth's system turns a push to Bitbucket's master branch into a production deployment, taking about two minutes for a commit group or single push. A Bitbucket post-hook sends commit details to a toolchain server, which filters out non-master and merge commits, groups related changes using file dependencies, and sends each group's top commit to an integration test server. Tests run on a separate test branch that simulates production; failures roll it back to the last stable commit and notify the developer, while passing changes enter a release queue. The toolchain uses Fabric to choose which servers to deploy to and whether to restart services, collect static files, or run database migrations based on changed files. The account says the setup supports a tightly integrated codebase deployed across many server types and EC2 instances. Its reliability depends on integration tests, which the author says reduce the uncertainty of bad commits reaching production as test coverage grows.

## Source excerpt

This is one of the coolest and important thing we recently built at HackerEarth. What's so cool about it? Just have a little patience, you will soon find out. But make sure you read till the end :) I will try to make this post as resourceful, and clear so that people who always wondered how to implement a Continuous Deployment System(CDS) can gain insights. At HackerEarth, we iterate over our product quickly and roll out new features as soon as they are production ready. In last two weeks, we deployed 100+ commits in production, and a major release is scheduled to be launched within a few days comprising over 150+ commits. Those commits consists of changes to backend app, website, static files, database and many more. We have over a dozen different types of servers running e.g. webserver, code-checker server, log server, wiki server, realtime server, NoSQL server, etc. And all of them are running on multiple ec2 instance at any point of time. Our codebase is still tightly integrated as one single project with many different components required for each server. And when there are changes to codebase, all the related servers and components need to be updated when deploying in production. Doing that manually would have just driven us crazy, and would have been a total waste of time! See the table of commits deployed on a single day, and that too on lighter day! With such speed of work, we needed a automated deployment system along with automated testing. Our implementation of CDS helps the team to roll out features in production with just a single command: git push origin master. Also, another reason to use CDS is that we are trying to automate the crap out of everything and I see us going in right direction. ####CDS Model The process begins with developer pushing bunch of commits from his master branch to remote repository which in our case is setup on Bitbucket. We have setup a post hook on Bitbucket, so as soon as Bitbucket receives commits from developer, it genera