GithubHelp home page GithubHelp logo

isabella232 / ecs-upload-task Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 99designs/ecs-upload-task

0.0 0.0 0.0 8.94 MB

Upload an ecs task definition and optionally deploy it

Go 92.84% Makefile 7.16%

ecs-upload-task's Introduction

ecs-upload-task

A very simple cli tool that will upload an ecs task and optionally update a service to reference it.

Designed as a partner tool to https://github.com/buildkite/ecs-run-task and shares the same task definition parser with environment substitution.

Example

Install it

go install github.com/99designs/ecs-upload-task@latest

or

curl -L --fail -o /usr/bin/ecs-upload-task \
  <release from https://github.com/99designs/ecs-upload-task/releases>

taskdefinition.yml

family: hello-world
containerDefinitions:
- essential: true
  image: ${IMAGE_NAME:-99designs/hello-world}
  memory: 64
  cpu: 10
  name: hello-world
  portMappings:
    - {containerPort: 1234, hostPort: 1234}
  environment:
    - {name: PORT, value: "1234"}

then take it for a dry-run to validate that the template is parsed successfully.

ecs-upload-task --file taskdefinition.yml --dry-run
Template taskdefinition.yml is parsed successfully

then register the task definition

ecs-upload-task --file taskdefinition.yml

Create a new ECS service referencing the task definition. Service templates can use the family name without the version, simply hello-world is enough.

Later, in your automated CI pipeline you can deploy by simply:

export IMAGE_NAME=99designs/hello-world:$FRESH_BUILD_NUMBER
ecs-upload-task --file taskdefinition.yml --service hello-world-2017-05-15-10-45

2017/11/14 18:02:32 Registering a task for hello-world
2017/11/14 18:02:34 Created arn:xxx:task-definition/hello-world:2
2017/11/14 18:02:34 Updating service hello-world-2017-05-15-10-45
2017/11/14 18:02:55 (service hello-world-2017-05-15-10-45) has started 1 tasks: (task 81b2963f-072a-479b-856f-26af2ec615f8).
2017/11/14 18:03:05 (service hello-world-2017-05-15-10-45) registered 1 instances in (elb hello-world-ELB-O5IUREC150O5)
2017/11/14 18:03:28 (service hello-world-2017-05-15-10-45) deregistered 1 instances in (elb hello-world-ELB-O5IUREC150O5)
2017/11/14 18:03:48 (service hello-world-2017-05-15-10-45) has stopped 1 running tasks: (task a3e3a91b-be05-4092-bcf6-47f2075933af).

Creating a new release

  1. Check out the the commit you want to create a release for, and tag it with appropriate semver convention:
$ git tag vx.x.x
$ git push --tags
  1. Create the binaries:

Binaries are compiled using gox. This provides a simple way to compile for multiple CPU architectures (amd64, arm64), which allows us to provide support for devices such as M1 Macs.

gox can be installed via go install

go install github.com/mitchellh/gox@latest

Then simply run the Makefile to compile.

$ make
  1. Go to https://github.com/99designs/ecs-upload-task/releases/new

  2. Select the tag version you just created

  3. Attach the binaries from ./bin/*

ecs-upload-task's People

Contributors

jondufty avatar miamollie avatar phantomwhale avatar vektah 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.