def execute(varsfile, templatefile, outputfile=None, configfile=None,<EOL>dryrun=False, build=False, push=False, verbose=False):
if dryrun and (build or push):<EOL><INDENT>jocker_lgr.error('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:100>)<EOL><DEDENT>_set_global_verbosity_level(verbose)<EOL>j = Jocker(varsfile, templatefile, outputfile, configfile, dryrun,<EOL>build, push)<EOL>formatted_text = j.generate()<EOL>if dryrun:<EOL><INDENT>g = j.dryrun(formatted_text)<EOL><DEDENT>if build or push:<EOL><INDENT>j.build_image()<EOL><DEDENT>if push:<EOL><INDENT>j.push_image()<EOL><DEDENT>if dryrun:<EOL><INDENT>return g<EOL><DEDENT>
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.