Skip to content

Add task role and network mode data when registering a new task definition #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ecs_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@ def client_kwargs(self, fn):
kwargs['family'] = self.task_definition['family']
kwargs['containerDefinitions'] = \
self.task_definition['containerDefinitions']

# add task role data if there is any
task_role_arn = self.new_task_definition.get('taskRoleArn')
if task_role_arn:
kwargs['taskRoleArn'] = task_role_arn

# add network mode data if there is any
network_mode = self.new_task_definition.get('networkMode')
if network_mode:
kwargs['networkMode'] = network_mode

# optional kwargs from args
if self.args.get('image'):
kwargs['containerDefinitions'][0]['image'] = \
Expand All @@ -244,6 +255,7 @@ def client_kwargs(self, fn):
kwargs['cluster'] = self.cluster
kwargs['service'] = self.service_name
kwargs['taskDefinition'] = self.new_task_definition['family']

# optional kwargs from args
deployment_config = {}
deployment_config = self._arg_kwargs(deployment_config, 'min',
Expand Down Expand Up @@ -277,5 +289,6 @@ def client_fn(self, fn):
print('Exception: %s' % e)
sys.exit(1)


if __name__ == '__main__':
CLI()
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def run_tests(self):

setup(
name='ecs-deploy-py',
version='0.1.3',
version='0.1.4',
url='http://github.com/cuttlesoft/ecs-deploy.py',
download_url='https://github.com/cuttlesoft/ecs-deploy.py/tarball/0.1.3',
download_url='https://github.com/cuttlesoft/ecs-deploy.py/tarball/0.1.4',
license='MIT',
author='Cuttlesoft, LLC',
author_email='[email protected]',
Expand All @@ -74,14 +74,14 @@ def run_tests(self):
zip_safe=False,
platforms='any',
install_requires=[
'boto3==1.4.0',
'botocore==1.4.56',
'docutils==0.12',
'futures==3.0.5',
'jmespath==0.9.0',
'python-dateutil==2.5.3',
's3transfer==0.1.4',
'six==1.10.0'
'boto3>=1.4.0',
'botocore>=1.4.56',
'docutils>=0.12',
'futures>=3.0.5',
'jmespath>=0.9.0',
'python-dateutil>=2.5.3',
's3transfer>=0.1.4',
'six>=1.10.0'
],
cmdclass={'test': PyTest},
classifiers=[
Expand Down