Automated deploys with Docker Hub and Nirmata
As companies strive to attain achieve software development agility, they are looking to automate each phase of their software development pipeline. The ultimate goal is to fully automate the deployment of code to production, triggered when a developer checks in a fix or a feature. Companies such as Netflix have built extensive tooling to enable their developers to achieve this level of sophisticated automation . In this post, I will describe how deployments of containerized applications can be completely automated with GitHub, Docker Hub and Nirmata.
Docker Hub has built-in integration with GitHub and Bitbucket to automatically build a Docker image when change is committed to a GitHub repository that has automated builds enabled . The only requirement is that a Dockerfile be placed in that repository. This is very convenient!
Now that Docker image builds are automated, the next step is to automate the deployment of these builds. This can be done using Docker Hub webhooks  and Nirmata. Nirmata is a SaaS for deployment and operation of application containers. To trigger automated deployments of your application follow these steps.
- Log in to Nirmata and create a blueprint for your application.
- Add your cloud resources (VMs) to Nirmata. These resources will be used to deploy your application containers.
- Deploy your application to an environment. Environment is the runtime instantiation of your application and contains your running application containers
- Now, go to Docker Hub and add webhooks for your image repositories that should trigger automated deploys. The URL is displayed below:
You can find the tenant-id on the Settings->Account page in Nirmata web interface.
Thats it! You have now setup an automated deployment pipeline. Whenever a change is committed to your GitHub repository, a Docker image will be automatically build and deployed to your running environment in Nirmata. Complete operation may take a few minutes depending on how long it takes to build the container image as well as your Update Policy settings  in Nirmata.
Nirmata provides an option to automatically deploy new Docker images, or simply create a notification when a new image is available so that it can be manually deployed. In case your application contains multiple containers running the same image, then a rolling upgrade is performed based on preconfigured policy settings so that downtime is minimized.
While this level of automation is great, there are several other capabilities needed to achieve the level of automation companies such as Netflix have built. At Nirmata, our mission is to bring these capabilities to our customers to help them achieve the software DevOps agility they need to be successful. Stay tuned for more exciting features we will be announcing!
 From Code to Monkeys: Continuous Delivery at Netflix – http://www.infoq.com/presentations/netflix-continuous-delivery
 Automated Builds on Docker Hub – https://docs.docker.com/docker-hub/builds/
 Docker Hub Webhooks – https://docs.docker.com/docker-hub/builds/#webhooks
 Nirmata Update Policy – https://docs.nirmata.io/en/latest/Environments.html#edit-update-policy