Skip to content

Commit 45c29a9

Browse files
committed
Merge branch 'release/1.10.2'
2 parents a21dc07 + 1a93c80 commit 45c29a9

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

ecs_deploy/__init__.py

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

ecs_deploy/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,13 @@ def scale(cluster, service, desired_count, access_key_id, secret_access_key, reg
304304
@click.option('--subnet', type=str, multiple=True, help='A subnet ID to launch the task within. Required for launch type FARGATE (multiple values possible)')
305305
@click.option('--securitygroup', type=str, multiple=True, help='A security group ID to launch the task within. Required for launch type FARGATE (multiple values possible)')
306306
@click.option('--public-ip', is_flag=True, default=False, help='Should a public IP address be assigned to the task (default: False)')
307+
@click.option('--platform-version', help='The version of the Fargate platform on which to run the task. Optional, FARGATE launch type only.', required=False)
307308
@click.option('--region', help='AWS region (e.g. eu-central-1)')
308309
@click.option('--access-key-id', help='AWS access key id')
309310
@click.option('--secret-access-key', help='AWS secret access key')
310311
@click.option('--profile', help='AWS configuration profile name')
311312
@click.option('--diff/--no-diff', default=True, help='Print what values were changed in the task definition')
312-
def run(cluster, task, count, command, env, secret, launchtype, subnet, securitygroup, public_ip, region, access_key_id, secret_access_key, profile, diff):
313+
def run(cluster, task, count, command, env, secret, launchtype, subnet, securitygroup, public_ip, platform_version, region, access_key_id, secret_access_key, profile, diff):
313314
"""
314315
Run a one-off task.
315316
@@ -330,7 +331,7 @@ def run(cluster, task, count, command, env, secret, launchtype, subnet, security
330331
if diff:
331332
print_diff(td, 'Using task definition: %s' % task)
332333

333-
action.run(td, count, 'ECS Deploy', launchtype, subnet, securitygroup, public_ip)
334+
action.run(td, count, 'ECS Deploy', launchtype, subnet, securitygroup, public_ip, platform_version)
334335

335336
click.secho(
336337
'Successfully started %d instances of task: %s' % (

ecs_deploy/ecs.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def update_service(self, cluster, service, desired_count, task_definition):
8888

8989
def run_task(self, cluster, task_definition, count, started_by, overrides,
9090
launchtype='EC2', subnets=(), security_groups=(),
91-
public_ip=False):
91+
public_ip=False, platform_version=None):
9292

9393
if launchtype == LAUNCH_TYPE_FARGATE:
9494
if not subnets or not security_groups:
@@ -105,14 +105,18 @@ def run_task(self, cluster, task_definition, count, started_by, overrides,
105105
}
106106
}
107107

108+
if platform_version is None:
109+
platform_version = 'LATEST'
110+
108111
return self.boto.run_task(
109112
cluster=cluster,
110113
taskDefinition=task_definition,
111114
count=count,
112115
startedBy=started_by,
113116
overrides=overrides,
114117
launchType=launchtype,
115-
networkConfiguration=network_configuration
118+
networkConfiguration=network_configuration,
119+
platformVersion=platform_version,
116120
)
117121

118122
return self.boto.run_task(
@@ -679,7 +683,7 @@ def __init__(self, client, cluster_name):
679683
self.started_tasks = []
680684

681685
def run(self, task_definition, count, started_by, launchtype, subnets,
682-
security_groups, public_ip):
686+
security_groups, public_ip, platform_version):
683687
try:
684688
result = self._client.run_task(
685689
cluster=self._cluster_name,
@@ -690,7 +694,8 @@ def run(self, task_definition, count, started_by, launchtype, subnets,
690694
launchtype=launchtype,
691695
subnets=subnets,
692696
security_groups=security_groups,
693-
public_ip=public_ip
697+
public_ip=public_ip,
698+
platform_version=platform_version,
694699
)
695700
self.started_tasks = result['tasks']
696701
return True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readme():
1111
return f.read()
1212

1313

14-
dependencies = ['click<7.0.0', 'botocore>=1.12.0', 'boto3>=1.4.7', 'future', 'requests', 'dictdiffer==0.8.0']
14+
dependencies = ['click<7.0.0', 'botocore>=1.17.47', 'boto3>=1.14.47', 'future', 'requests', 'dictdiffer==0.8.0']
1515

1616
setup(
1717
name='ecs-deploy',

tests/test_ecs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def test_task_set_command_with_multiple_arguments(task_definition):
411411
assert container[u'command'] == [u'run-application', u'arg1', u'arg2']
412412

413413
def test_task_set_command_with_empty_argument(task_definition):
414-
empty_argument = " "
414+
empty_argument = " "
415415
task_definition.set_commands(webserver=empty_argument + u'run-webserver arg1 arg2')
416416
for container in task_definition.containers:
417417
if container[u'name'] == u'webserver':
@@ -856,7 +856,7 @@ def test_run_action(client):
856856
def test_run_action_run(client, task_definition):
857857
action = RunAction(client, CLUSTER_NAME)
858858
client.run_task.return_value = dict(tasks=[dict(taskArn='A'), dict(taskArn='B')])
859-
action.run(task_definition, 2, 'test', LAUNCH_TYPE_EC2, (), (), False)
859+
action.run(task_definition, 2, 'test', LAUNCH_TYPE_EC2, (), (), False, None)
860860

861861
client.run_task.assert_called_once_with(
862862
cluster=CLUSTER_NAME,
@@ -867,7 +867,8 @@ def test_run_action_run(client, task_definition):
867867
launchtype=LAUNCH_TYPE_EC2,
868868
subnets=(),
869869
security_groups=(),
870-
public_ip=False
870+
public_ip=False,
871+
platform_version=None,
871872
)
872873

873874
assert len(action.started_tasks) == 2
@@ -960,7 +961,7 @@ def update_service(self, cluster, service, desired_count, task_definition):
960961

961962
def run_task(self, cluster, task_definition, count, started_by, overrides,
962963
launchtype='EC2', subnets=(), security_groups=(),
963-
public_ip=False):
964+
public_ip=False, platform_version=None):
964965
if not self.access_key_id or not self.secret_access_key:
965966
raise EcsConnectionError(u'Unable to locate credentials. Configure credentials by running "aws configure".')
966967
if cluster == 'unknown-cluster':

0 commit comments

Comments
 (0)