Exemplo n.º 1
0
def list_images(env: str, region: Optional[str]) -> None:
    context: "Context" = ContextSerDe.load_context_from_ssm(env_name=env,
                                                            type=Context)
    names = utils.extract_images_names(env_name=env)
    if names:
        print_list(
            tittle=
            f"Available docker images into the {stylize(context.name)} env:",
            items=[k for k in names],
        )
    else:
        click.echo(
            f"There is no docker image(s) into the {stylize(context.name)} env."
        )
Exemplo n.º 2
0
def list_images(env: str, region: Optional[str]) -> None:
    context: "Context" = ContextSerDe.load_context_from_ssm(env_name=env,
                                                            type=Context)
    names = utils.extract_images_names(env_name=env)
    _logger.debug("names: %s", names)
    if names:
        uris = _fetch_repo_uri(names=names, context=context)
        print_list(
            tittle=
            f"Available docker images into the {stylize(context.name)} env:",
            items=[f"{k} {stylize(':')} {v}" for k, v in uris.items()],
        )
    else:
        click.echo(
            f"Thre is no docker images into the {stylize(context.name)} env.")
Exemplo n.º 3
0
 def _create_ecr_repos(self) -> List[ecr.Repository]:
     current_images_names = extract_images_names(env_name=self.context.name)
     current_images_names = list(set(current_images_names) - set(self.remove_images))
     repos = [self.create_repo(image_name=r) for r in current_images_names]
     for image_name in self.add_images:
         if image_name not in current_images_names:
             repos.append(self.create_repo(image_name=image_name))
             current_images_names.append(image_name)
     if current_images_names:
         current_images_names.sort()
         CfnOutput(
             scope=self,
             id="repos",
             export_name=f"orbit-{self.context.name}-repos",
             value=",".join([x for x in current_images_names]),
         )
     return repos