Skip to content

Commit 06c35f9

Browse files
committed
Merge branch 'release/1.12.0'
2 parents c514f3b + bdc4556 commit 06c35f9

File tree

10 files changed

+1770
-34
lines changed

10 files changed

+1770
-34
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ python:
33
- "2.7"
44
- "3.5"
55
- "3.6"
6-
- "3.7-dev"
6+
- "3.7"
7+
- "3.8"
8+
- "3.9"
79
install: pip install tox-travis
810
script: tox
911
after_script:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6-alpine3.8
1+
FROM python:3.8-alpine3.13
22

33
ADD . /usr/src/app
44
WORKDIR /usr/src/app

README.rst

Lines changed: 124 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ECS Deploy
22
----------
33

4-
.. image:: https://travis-ci.org/fabfuel/ecs-deploy.svg?branch=develop
5-
:target: https://travis-ci.org/fabfuel/ecs-deploy
4+
.. image:: https://badge.fury.io/py/ecs-deploy.svg
5+
:target: https://badge.fury.io/py/ecs-deploy
66

7-
.. image:: https://scrutinizer-ci.com/g/fabfuel/ecs-deploy/badges/coverage.png?b=develop
8-
:target: https://scrutinizer-ci.com/g/fabfuel/ecs-deploy
7+
.. image:: https://travis-ci.com/fabfuel/ecs-deploy.svg?branch=develop
8+
:target: https://travis-ci.com/github/fabfuel/ecs-deploy
99

10-
.. image:: https://scrutinizer-ci.com/g/fabfuel/ecs-deploy/badges/quality-score.png?b=develop
10+
.. image:: https://scrutinizer-ci.com/g/fabfuel/ecs-deploy/badges/coverage.png?b=develop
1111
:target: https://scrutinizer-ci.com/g/fabfuel/ecs-deploy
1212

1313
`ecs-deploy` simplifies deployments on Amazon ECS by providing a convinience CLI tool for complex actions, which are executed pretty often.
@@ -42,7 +42,7 @@ Updating a cron job::
4242

4343
Update a task definition (without running or deploying)::
4444

45-
$ ecs update my-cluster my-task
45+
$ ecs update my-task
4646

4747

4848
Installation
@@ -85,20 +85,20 @@ Currently the following actions are supported:
8585

8686
deploy
8787
======
88-
Redeploy a service either without any modifications or with a new image, environment variable and/or command definition.
88+
Redeploy a service either without any modifications or with a new image, environment variable, docker label, and/or command definition.
8989

9090
scale
9191
=====
9292
Scale a service up or down and change the number of running tasks.
9393

9494
run
9595
===
96-
Run a one-off task based on an existing task-definition and optionally override command and/or environment variables.
96+
Run a one-off task based on an existing task-definition and optionally override command, environment variables and/or docker labels.
9797

9898
update
9999
======
100100
Update a task definition by creating a new revision to set a new image,
101-
environment variable and/or command definition, etc.
101+
environment variable, docker label, and/or command definition, etc.
102102

103103
cron (scheduled task)
104104
=====================
@@ -230,6 +230,45 @@ To reset all existing secrets (secret environment variables) of a task definitio
230230

231231
This will remove **all other** existing secret environment variables of **all containers** of the task definition, except for the new secret variable `NEW_SECRET` with the value coming from the AWS Parameter Store with the name "KEY_OF_SECRET_IN_PARAMETER_STORE" in the webserver container.
232232

233+
234+
Set environment via .env files
235+
==============================
236+
Instead of setting environment variables separately, you can pass a .env file per container to set the whole environment at once. You can either point to a local file or a file stored on S3, via::
237+
238+
$ ecs deploy my-cluster my-service --env-file my-app env/my-app.env
239+
240+
$ ecs deploy my-cluster my-service --s3-env-file my-app arn:aws:s3:::my-ecs-environment/my-app.env
241+
242+
243+
Set a docker label
244+
===================
245+
To add a new or adjust an existing docker labels of a specific container, run the following command::
246+
247+
$ ecs deploy my-cluster my-service -d webserver somelabel somevalue
248+
249+
This will modify the **webserver** container definition and add or overwrite the docker label "somelabel" with the value "somevalue". This way you can add new or adjust already existing docker labels.
250+
251+
252+
Adjust multiple docker labels
253+
=============================
254+
You can add or change multiple docker labels at once, by adding the `-d` (or `--docker-label`) options several times::
255+
256+
$ ecs deploy my-cluster my-service -d webserver somelabel somevalue -d webserver otherlabel othervalue -d app applabel appvalue
257+
258+
This will modify the definition **of two containers**.
259+
The **webserver**'s docker label "somelabel" will be set to "somevalue" and the label "otherlabel" to "othervalue".
260+
The **app**'s docker label "applabel" will be set to "appvalue".
261+
262+
263+
Set docker labels exclusively, remove all other pre-existing docker labels
264+
==========================================================================
265+
To reset all existing docker labels of a task definition, use the flag ``--exclusive-docker-labels`` ::
266+
267+
$ ecs deploy my-cluster my-service -d webserver somelabel somevalue --exclusive-docker-labels
268+
269+
This will remove **all other** existing docker labels of **all containers** of the task definition, except for the label "somelabel" with the value "somevalue" in the webserver container.
270+
271+
233272
Modify a command
234273
================
235274
To change the command of a specific container, run the following command::
@@ -260,6 +299,82 @@ To change or set the role, the service's task should run as, use the following c
260299

261300
This will set the task role to "MySpecialEcsTaskRole".
262301

302+
303+
Set CPU and memory reservation
304+
==============================
305+
- Set the `cpu` value for a task definition: :code:`--cpu <container_name> 0`.
306+
- Set the `memory` value (`hard limit`) for a task definition: :code:`--memory <container_name> 256`.
307+
- Set the `memoryreservation` value (`soft limit`) for a task definition: :code:`--memoryreservation <container_name> 256`.
308+
309+
Set privileged or essential flags
310+
=================================
311+
- Set the `privliged` value for a task definition: :code:`--privileged <container_name> True|False`.
312+
- Set the `essential` value for a task definition: :code:`--essential <container_name> True|False`.
313+
314+
Set logging configuration
315+
=========================
316+
Set the `logConfiguration` values for a task definition::
317+
318+
--log <container_name> awslogs awslogs-group <log_group_name>
319+
--log <container_name> awslogs awslogs-region <region>
320+
--log <container_name> awslogs awslogs-stream-prefix <stream_prefix>
321+
322+
323+
Set port mapping
324+
================
325+
- Set the `port mappings` values for a task definition: :code:`--port <container_name> <container_port> <host_port>`.
326+
327+
- Supports :code:`--exclusive-ports`.
328+
- The `protocol` is fixed to `tcp`.
329+
330+
Set volumes & mount points
331+
==========================
332+
- Set the `volumes` values for a task definition :code:`--volume <volume_name> /host/path`.
333+
334+
- :code:`<volume_name>` can then be used with :code:`--mount`.
335+
- Set the `mount points` values for a task definition: :code:`--mount <container_name> <volume_name> /container/path`.
336+
337+
- Supports :code:`--exclusive-mounts`.
338+
339+
- :code:`<volume_name>` is the one set by :code:`--volume`.
340+
- Set the `ulimits` values for a task definition: :code:`--ulimit <container_name> memlock 67108864 67108864`.
341+
342+
- Supports :code:`--exclusive-ulimits`.
343+
- Set the `systemControls` values for a task definition: :code:`--system-control <container_name> net.core.somaxconn 511`.
344+
345+
- Supports :code:`--exclusive-system-controls`.
346+
- Set the `healthCheck` values for a task definition: :code:`--health-check <container_name> <command> <interval> <timeout> <retries> <start_period>`.
347+
348+
349+
Set Health Checks
350+
=================
351+
- Example :code:`--health-check webserver "curl -f http://localhost/alive/" 30 5 3 0`
352+
353+
354+
Placeholder Container
355+
=====================
356+
- Add placeholder containers: :code:`--add-container <container_name>`.
357+
- To comply with the minimum requirements for a task definition, a placeholder container is set like this:
358+
+ The contaienr name is :code:`<container_name>`.
359+
+ The container image is :code:`PLACEHOLDER`.
360+
+ The container soft limit is :code:`128`.
361+
- The idea is to set sensible values with the deployment.
362+
363+
It is possible to add and define a new container with the same deployment::
364+
365+
--add-container redis --image redis redis:6 --port redis 6379 6379
366+
367+
Remove containers
368+
=================
369+
- Containers can be removed: :code:`--remove-container <container_name>`.
370+
371+
- Leaves the original containers, if all containers would be removed.
372+
373+
374+
All but the container flags can be used with `ecs deploy` and `ecs cron`.
375+
The container flags are used with `ecs deploy` only.
376+
377+
263378
Ignore capacity issues
264379
======================
265380
If your cluster is undersized or the service's deployment options are not optimally set, the cluster

ecs_deploy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.11.3'
1+
VERSION = '1.12.0'

0 commit comments

Comments
 (0)