Code Monkey home page Code Monkey logo

deploy-ecs-basic's Introduction

Deploy a Node.js application to Amazon ECS

Run Status Coverage Badge

AyeAye

A simple Node JS application with unit tests and coverage reports using mocha and istanbul. It also does a docker build once CI passes and then pushes the image to Amazon EC2 Container Registry

Setup

To run this example successfully, you must first perform some setup steps to customize shippable.yml to point to your ECR and ECS accounts.

1. Create an AWS integration

In order to allow Shippable to connect to your AWS services, you need to add an integration through the Shippable UI. This integration will be referenced in the YAML as needed.

Log in to Shippable and follow instructions in the docs to create an AWS keys integration. Note down the name of the integration you created.

2. Update YAML

Fork this repository to your account.

All configuration is stored in the shippable.yml file at the root of this repository. You will need to make the following updates to customize the standard YAML included with this example:

  • Change ECR_REPO (line 19) to point to your ECR repo. Please make sure the repo already exists on ECR.
  • Update the integrationName(47) in the integration.hub section with the name of your AWS integration.
  • Under resources, update the deploy-ecs-basic-image resource with the following:
    • integration should point to your AWS integration name
    • sourceName should point to the ECR repo
  • Under resources, update the deploy-ecs-basic-ecs-cluster resource with the following:
    • integration should point to your AWS integration name
    • sourceName should point to your ECS cluster name. Please make sure the cluster already exists.
    • region should point to the region of your ECS cluster.

Commit your changes to source control.

Run CI: Run some tests, build a Docker image and push to ECR

  • Enable your project for CI on Shippable
  • Commit a small change to your repository (add a space or character in readme file). This will automatically trigger a build on Shippable. You can also trigger a manual build through the Shippable UI.
  • The build will build your Docker image and push it to ECR.

Enable the CD workflow: Deploy container to ECS

  • Next, you need to enable config to deploy your Docker container to ECS. This logic is contained in the jobs and resources sections of your YAML, which is known as Assembly Line config in Shippable.
  • Add your Assembly Line. This will ensure that your jobs and resources sections are read.
  • Rerun your CI job with another commit to the repository or with a manual build. The workflow should now trigger end to end and your container should be deployed to ECS.

deploy-ecs-basic's People

Contributors

ambarish2012 avatar manishas avatar riturajcse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.