dplycli.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:deployfish 作者: caltechads 项目源码 文件源码
def cluster_ssh(ctx, service_name):
    """
    SSH to the specified EC2 system in the ECS cluster running SERVICE_NAME.
    """
    service = Service(
        yml=Config(filename=ctx.obj['CONFIG_FILE'], env_file=ctx.obj['ENV_FILE']).get_service(service_name))
    ips = service.get_host_ips()
    for index, ip in enumerate(ips):
        click.echo("Instance {}: {}".format(index+1, ip))

    instance = click.prompt("Which instance to ssh to?", type=int)
    if instance > len(ips):
        click.echo("That is not a valid instance.")
        return
    instance_ip = ips[instance-1]
    service.cluster_ssh(instance_ip)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号