Skip to content

Sample Shippable assembly line using declarative deploy jobs - build docker image, push to Amazon EC/2 Container Registry (ECR), deploy to multiple environments in Amazon EC/2 Container Service (ECS). Uses 'loadBalancer' resource.

Notifications You must be signed in to change notification settings

shippableSamples/node-ecr-deploy-ecs-loadbalancer

Repository files navigation

AyeAye

Docker Build, Continuous Integration, and Deployment to Amazon EC/2 Container Service for a Node JS application

Run Status Coverage Badge

A simple Node JS application with unit tests and coverage reports using mocha and istanbul.

This repo demonstrates the following features:

  • Set up serverless CI, i.e. on Shippable-provided infrastructure
  • Set up CD pipelines for a Amazon EC/2 Container Service (Amazon ECS) cluster
  • Perform CI tests
  • Perform docker build and push image to Amazon EC/2 Container Registry (Amazon ECR)
  • Automatically deploy image to TEST environment
  • Manually deploy image to PROD environment
  • Automatically register Amazon ECS services with application load balancer (ALB) for each environment

Run CI for this repo on Shippable

  • Fork this repo into your source code account (e.g. GitHub)
  • Create an account (or login) on Shippable with your SCM account
  • Create a Amazon ECR integration on Shippable for your Google account
  • Update the CI configuration in shippable.yml file with your integration names (see comments in file)

Add Continuous Delivery pipelines to deploy to Amazon ECS

  • Create an integration for Amazon ECS
  • All pipeline config is in shippable.resources.yml and shippable.jobs.yml. Check these files and update config wherever the comment asks you to replace with your specific values
  • Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-ecs-test' and run the job
  • Your app should be deployed to your Amazon ECS cluster labeled as your TEST environment
  • Follow instructions to connect your Continuous Integration project to your Continuous Delivery pipelines(for this demo, just uncomment the trigger integration in shippable.yml)
  • Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-ecs-prod' and run the job to deploy as your PROD environment
  • Make a change to your forked repo and commit to GitHub - watch your pipeline automatically execute CI with push to Amazon ECR and automatic deployment to the TEST environment in Amazon ECS
  • Then right-click to deploy the newest changes to the PROD environment

Your end-to-end pipeline is complete! Now, any change you make to the application will be deployed to your Amazon ECS TEST environment and be ready to manually deploy to your PROD environment, as well.

CI console screenshot

CI Console Log

Amazon ECR integration screenshot

Integration View

CD pipeline screenshot

CD Pipeline

Set up an Amazon ECS cluster

See the Amazon ECS documentation to set up an Amazon ECS cluster

About

Sample Shippable assembly line using declarative deploy jobs - build docker image, push to Amazon EC/2 Container Registry (ECR), deploy to multiple environments in Amazon EC/2 Container Service (ECS). Uses 'loadBalancer' resource.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published