def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)

    image = opts["<image>"]
    biobox_type = opts["<biobox_type>"]
    tty = not "--no-tty" in opts["<args>"]
    remove = not "--no-rm" in opts["<args>"]

    docker.exit_if_no_image_available(image)

    params = get_login_parameters(biobox_type)
    if params is None:
        error.err_exit("unknown_command", {
            "command_type": "biobox type",
            "command": biobox_type
        })

    volumes = list(
        map(lambda d: create_login_volume(d['directory'], d['files']), params))
    ctnr = docker.create_tty(image, tty, volumes)
    docker.login(ctnr)
    rm_login_dir()

    if remove:
        docker.remove(ctnr)
def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)
    module = util.select_module("biobox_type", opts["<biobox_type>"])
    Biobox = next(util.get_subclasses(module, ABiobox))
    bbx = Biobox()
    ctnr = bbx.run(argv)
    if not '--no-rm' in argv:
        ctn.remove(ctnr)
Example #3
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)
    module = util.select_module("biobox_type", opts["<biobox_type>"])
    Biobox = next(util.get_subclasses(module, ABiobox))
    bbx = Biobox()
    ctnr = bbx.run(argv)
    if not '--no-rm' in argv:
        ctn.remove(ctnr)
Example #4
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)

    image = opts["<image>"]
    biobox_type = opts["<biobox_type>"]
    tty = not "--no-tty" in opts["<args>"]
    remove = not "--no-rm" in opts["<args>"]

    docker.exit_if_no_image_available(image)

    params = get_login_parameters(biobox_type)
    if params is None:
        error.err_exit("unknown_command", {"command_type": "biobox type", "command": biobox_type})

    volumes = list(map(lambda d: create_login_volume(d["directory"], d["files"]), params))
    ctnr = docker.create_tty(image, tty, volumes)
    docker.login(ctnr)
    rm_login_dir()

    if remove:
        docker.remove(ctnr)
Example #5
0
 def remove(self, container):
     """
         Removes a container
         Note this method is not tested due to limitations of circle ci
         """
     ctn.remove(container)
def remove_container(container):
    if not is_ci_server():
        ctn.remove(container)
 def remove(self, container):
         """
         Removes a container
         Note this method is not tested due to limitations of circle ci
         """
         ctn.remove(container)