The CI/CD and DevOps Blog

Deploy a WAR Package From Nexus To AWS Using Ansible

This tutorial explains how to deploy a Java-based WAR package stored on Nexus Repository Manager to a virtual machine running on AWS EC2 using Ansible playbooks.

This document assumes you're familiar with the following concepts:

The best way to get started is to install Ansible on your local machine, and run your playbook manually. Follow the instructions in this blog to achieve this workflow.  Once you understand the mechanics of it, you should consider automating your workflow by following our documentation on Automated deployment of a JAR/WAR package from Nexus to AWS using Ansible.

Provision an AWS VPC using Ansible

This tutorial explains how to manually provision a AWS Virtual Private Cloud(VPC) using Ansible. Before you start, you should be familiar with the following concepts:

The best way to get started is to install ansible and run playbooks manually on your local machine to provision a VM. The first section of this tutorial explains how to do that. However, manual execution isn't the best and most efficient way to run ansible playbooks, so we will take a look at the challenges and learn how to automate this workflow with a step-by-step tutorial.

Provision AWS EC2 virtual machine with Ansible

This tutorial explains how to manually provision an AWS EC2 virtual machine using Ansible. Before you start, you should be familiar with the following concepts:

 The best way to get started is to install ansible and run playbooks manually on your local machine to provision a VM. The first section of this tutorial explains how to do that. However, manual execution isn't the best and most efficient way to run ansible playbooks, so we will take a look at the challenges and learn how to automate this workflow.

Continuously deploy to Amazon ECS

Amazon provides a hosted Container Service for Docker called EC2 Container Service (ECS) as part of its container focused suite of services. Many of our customers seem to love the ECR (EC2 Container Registry) and ECS combination to store and run their applications. Amazon ECS can be accessed by going to your AWS Management Console, selecting EC2 Container Service from the list of Services. 

In part I of this series, I demonstrated a simple scenario where we built and pushed a Docker image to ECR as part of the CI build workflow. In this blog post, I will show how you can set up deployment of the same sample application into Amazon ECS, In the last part of this series, I'll show how you can complete your Continuous Delivery pipeline with deployment into subsequent environments, promotion workflows between environments, and release management.

If you want to follow along with the step by step tutorial you can fork our sample, sign in to Shippable, and set up the CI/CD workflow as described. 

Sign in for free

Pushing your Docker image to Amazon ECR after CI

Amazon provides a hosted private registry for Docker images called EC2 Container Registry (ECR) as part of its container focused suite of services. Many of our customers seem to love the ECR and ECS (EC2 Container Service) combination to store and run their applications. Amazon ECR can be accessed by going to your AWS Management Console, selecting EC2 Container Service, and clicking on Repositories in the left sidebar. 

In this blog post, I will go through a simple scenario with a sample project where we enable a project for CI, build a docker image as part of the workflow, test the image, and then push it to Amazon ECR. In the next blog, we will then set up the rest of the Continuous Delivery pipeline for the sample application.

If you want to follow along with the step by step tutorial you can fork the sample used in this tutorial, sign in to Shippable, and set up the CI/CD workflow as described. 

Sign in for free