jocker/jocker.py
def execute(varsfile, templatefile, outputfile=None, configfile=None,
            dryrun=False, build=False, push=False, verbose=False):
    """generates a Dockerfile, builds an image and pushes it to DockerHub

    A `Dockerfile` will be generated by Jinja2 according to the `varsfile`
    imported. If build is true, an image will be generated from the
    `outputfile` which is the generated Dockerfile and committed to the
    image:tag string supplied to `build`.
    If push is true, a build will be triggered and the produced image
    will be pushed to DockerHub upon completion.

    :param string varsfile: path to file with variables.
    :param string templatefile: path to template file to use.
    :param string outputfile: path to output Dockerfile.
    :param string configfile: path to yaml file with docker-py config.
    :param bool dryrun: mock run.
    :param build: False or the image:tag to build to.
    :param push: False or the image:tag to build to. (triggers build)
    :param bool verbose: verbose output.
    """
    if dryrun and (build or push):
        jocker_lgr.error('dryrun requested, cannot build.')
        sys.exit(100)

    _set_global_verbosity_level(verbose)
    j = Jocker(varsfile, templatefile, outputfile, configfile, dryrun,
               build, push)
    formatted_text = j.generate()
    if dryrun:
        g = j.dryrun(formatted_text)
    if build or push:
        j.build_image()
    if push:
        j.push_image()
    if dryrun:
        return g
def execute(varsfile, templatefile, outputfile=None, configfile=None,
            dryrun=False, build=False, push=False, verbose=False):
    """generates a Dockerfile, builds an image and pushes it to DockerHub

    A `Dockerfile` will be generated by Jinja2 according to the `varsfile`
    imported. If build is true, an image will be generated from the
    `outputfile` which is the generated Dockerfile and committed to the
    image:tag string supplied to `build`.
    If push is true, a build will be triggered and the produced image
    will be pushed to DockerHub upon completion.

    :param string varsfile: path to file with variables.
    :param string templatefile: path to template file to use.
    :param string outputfile: path to output Dockerfile.
    :param string configfile: path to yaml file with docker-py config.
    :param bool dryrun: mock run.
    :param build: False or the image:tag to build to.
    :param push: False or the image:tag to build to. (triggers build)
    :param bool verbose: verbose output.
    """
    if dryrun and (build or push):
        jocker_lgr.error('dryrun requested, cannot build.')
        sys.exit(100)

    _set_global_verbosity_level(verbose)
    j = Jocker(varsfile, templatefile, outputfile, configfile, dryrun,
               build, push)
    formatted_text = j.generate()
    if dryrun:
        g = j.dryrun(formatted_text)
    if build or push:
        j.build_image()
    if push:
        j.push_image()
    if dryrun:
        return g
def execute ( varsfile , templatefile , outputfile = None , configfile = None , dryrun = False , build = False , push = False , verbose = False ) : if dryrun and ( build or push ) : jocker_lgr . error ( 'dryrun requested, cannot build.' ) sys . exit ( 100 ) _set_global_verbosity_level ( verbose ) j = Jocker ( varsfile , templatefile , outputfile , configfile , dryrun , build , push ) formatted_text = j . generate ( ) if dryrun : g = j . dryrun ( formatted_text ) if build or push : j . build_image ( ) if push : j . push_image ( ) if dryrun : return g
generates a Dockerfile, builds an image and pushes it to DockerHub

    A `Dockerfile` will be generated by Jinja2 according to the `varsfile`
    imported. If build is true, an image will be generated from the
    `outputfile` which is the generated Dockerfile and committed to the
    image:tag string supplied to `build`.
    If push is true, a build will be triggered and the produced image
    will be pushed to DockerHub upon completion.

    :param string varsfile: path to file with variables.
    :param string templatefile: path to template file to use.
    :param string outputfile: path to output Dockerfile.
    :param string configfile: path to yaml file with docker-py config.
    :param bool dryrun: mock run.
    :param build: False or the image:tag to build to.
    :param push: False or the image:tag to build to. (triggers build)
    :param bool verbose: verbose output.
generates a Dockerfile builds an image and pushes it to DockerHub