GithubHelp home page GithubHelp logo

shgtkshruch / ecs-blue-green-deploy-sample Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 6 KB

Home Page: https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html

Dockerfile 17.48% HTML 82.52%
ecs codedeploy github-actions

ecs-blue-green-deploy-sample's Introduction

ecs-blue-green-deploy-sample

https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html

  1. Cerate Docker image and push to ECR
  2. Create ECS task definition and AppSpec source files
  3. Create ALB and taget groups
  4. Create CodeDeploy application and deployment group
  5. Create deployment pipeline on GitHub Actions
  6. Update static-html-directory/index.html and push Gitub

Create Nginx repository in ECR

# Pull Nginx image
$ docker pull nginx

# Create ECR repository
$ aws ecr create-repository --repository-name nginx

# Add a tag to Nginx image
$ docker tag nginx:latest 353381651656.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:latest

# Login ECR
$ aws ecr get-login-password --region ap-northeast-1 | \
  docker login --username AWS --password-stdin 353381651656.dkr.ecr.ap-northeast-1.amazonaws.com/nginx

# Push Nginx image to ECR
$ docker push 353381651656.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:latest

Register task definition

# Register task definition
$ aws ecs register-task-definition --cli-input-json file://taskdef.json

Creat ECS service

# Create ECS service
$ aws ecs create-service --service-name my-service --cli-input-json file://create-service.json

# Confirm
$ aws ecs describe-services --cluster ecs-blue-green-deploy --services my-service

Update Nginx

https://hub.docker.com/_/nginx

$ docker build -t 353381651656.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:latest .
$ docker run -d -p 8080:80 353381651656.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:latest

Open localhost:8080 in user browser.

ecs-blue-green-deploy-sample's People

Contributors

shgtkshruch avatar

Watchers

James Cloos avatar  avatar  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.