Skip to content

Ship your code to your ECS infraestructure with ecs-ship. Unless it's Friday in which case, don't ship it.

License

Notifications You must be signed in to change notification settings

AdRoll/ecs-ship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d4cf4a Â· Sep 20, 2024

History

28 Commits
Jun 21, 2024
Jun 21, 2024
Sep 20, 2024
Feb 25, 2021
Apr 7, 2021
Jun 21, 2024
Feb 25, 2021
Apr 7, 2021
Mar 10, 2022
Jun 21, 2024
Jun 21, 2024
Jun 21, 2024

Repository files navigation

🚢🇮🇹 ecs-ship

Yet another implementation of the ecs-deploy tool. ecs-ship will allow you to deploy changes to your ECS services by patching its current configuration.

Here are the steps that ecs-ship does for you:

  1. Grab the configuration from the cluster and service you specify.
  2. Apply the patches you can specify from the command line.
  3. Create a task definition out of the patched configuration.
  4. Deploy the service with the new task definition, wait for stability and if it's not reached roll back.

Usage

NAME:
   ecs-ship - Deploy your aws ecs services.

USAGE:
   ecs-deploy [options] <cluster> <service>

VERSION:
   1.1.0

GLOBAL OPTIONS:
   --updates FILE, -u FILE          Use an input FILE to describe service updates (default: stdin)
   --timeout DURATION, -t DURATION  Wait this DURATION for the service to be correctly updated (default: 5m0s)
   --no-color, -n                   Disable colored output (default: false)
   --no-wait, -w                    Disable waiting for updates to be completed. (default: false)
   --dry, -d                        Don't deploy just show what would change in the remote service (default: false)
   --help, -h                       show help (default: false)
   --version, -v                    print the version (default: false)

For the input file you can use this yaml schema:

cpu: "95"
memory: "34"
containerDefinitions:
  someContainer:
    cpu: 95
    environment:
      NAME: value
    image: "some-image:someTag"
    memory: 34
    memoryReservation: 34

Notice that every part of the input is optional, so the idea is that you just pass in the values that you need.

Getting ecs-ship

You can grab ssh ship from DockerHub from the repository nextroll/ecs-ship or from the console by:

docker pull nextroll/ecs-ship
docker run --rm nextroll/ecs-ship ecs-ship --help

You can also grab a Linux staticly linked binary from the releases page and drop it in your environment.

Finally you can grab the source code either from the AdRoll/ecs-ship repo or from the releases page and build yourself a fresh version using go.

go build .

Examples

Here's an example for updating a container image to the latest version:

cat << EOF | ecs-ship cluster service
containerDefinitions:
  someContainer:
    image: "some-image:latestTag"
EOF

Here's an example where you just change an environment variable of a sevice:

cat << EOF | ecs-ship cluster service
containerDefinitions:
  someContainer:
    environment:
      SECRETS_BUCKET: "s3://updated-secrets-bucket"
EOF

Here's yet ahother example where you just want to lower the cpu requirements of your service to lower your costs:

cat << EOF | ecs-ship cluster service
cpu: "50"
containerDefinitions:
  someContainer:
    cpu: 50

Development

We provide some make commands for your development convenience.

make mod      # load dependencies
make lint     # check code
make test     # run unit tests
make build    # build app (see artifacts/ecs-deploy)
make mockgen  # rebuild mocked entities

About

Ship your code to your ECS infraestructure with ecs-ship. Unless it's Friday in which case, don't ship it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages