Skip to content
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
5 changes: 3 additions & 2 deletions cloudlift/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def edit_config(name, environment):
@click.option("--build-arg", type=(str, str), multiple=True, help="These args are passed to docker build command "
"as --build-args. Supports multiple.\
Please leave space between name and value" )
def deploy_service(name, environment, version, build_arg):
ServiceUpdater(name, environment, None, version, dict(build_arg)).run()
@click.option('--component', help='nested service name', multiple=True)
def deploy_service(name, environment, version, build_arg, component):
ServiceUpdater(name, environment, None, version, dict(build_arg)).run(list(component))


@cli.command()
Expand Down
9 changes: 8 additions & 1 deletion cloudlift/deployment/service_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ def __init__(self, name, environment, env_sample_file, version=None,
self.working_dir = working_dir
self.build_args = build_args

def run(self):
def run(self, component=None):
log_warning("Deploying to {self.region}".format(**locals()))
self.init_stack_info()
if component is not None:
found = [str for str in self.ecs_service_names if any(sub in str for sub in component)]
self.ecs_service_names = found
if not found:
raise UnrecoverableException("Component {component} not found in service {self.name}".format(**locals()))
elif len(found) != 0 and len(found) != len(component):
log_warning("Few Component {found} found in service {self.name}".format(**locals()))
if not os.path.exists(self.env_sample_file):
raise UnrecoverableException('env.sample not found. Exiting.')
ecr_client = EcrClient(self.name, self.region, self.build_args)
Expand Down