Example #1
0
def _push_image(image):
    ext.dispatch("before_push", image)

    current_dir = os.getcwd()
    image_path = os.path.join(current_dir, image.get('path'))
    version = dockerfile.read_tag(image_path)
    use_versioning = image.get('use_versioning', False)

    repository = image.get('repository')
    release_tag = image.get('tag', 'latest')

    if use_versioning and version:
        local("docker push {0}:{1}".format(repository['url'], version))

    local("docker push {0}:{1}".format(repository['url'], release_tag))
Example #2
0
def _push_image(image):
    ext.dispatch("before_push", image)

    current_dir = os.getcwd()
    image_path = os.path.join(current_dir, image.get('path'))
    version = dockerfile.read_tag(image_path)
    use_versioning = image.get('use_versioning', False)

    repository = image.get('repository')
    release_tag = image.get('tag', 'latest')

    if use_versioning and version:
        local("docker push {0}:{1}".format(repository['url'], version))

    local("docker push {0}:{1}".format(repository['url'], release_tag))
Example #3
0
def _build_image(image):
    current_dir = os.getcwd()
    image_path = os.path.join(current_dir, image.get('path'))
    version = dockerfile.read_tag(image_path)

    # Tag release (master/develop)
    use_versioning = image.get('use_versioning', False)
    repository = image.get('repository')
    release_tag = image.get('tag', 'latest')
    extra_args = image.get('extra_args', "")

    local("docker build {0} -t {1}:{2} {3}".format(extra_args,
                                                   image.get('name'),
                                                   release_tag, image_path))

    if use_versioning and version:
        local("docker build {0} -t {1}:{2} {3}".format(extra_args,
                                                       repository['url'],
                                                       version, image_path))

    local("docker tag {0}:{1} {2}:{3}".format(image['name'], release_tag,
                                              repository['url'], release_tag))
Example #4
0
def _build_image(image):
    current_dir = os.getcwd()
    image_path = os.path.join(current_dir, image.get('path'))
    version = dockerfile.read_tag(image_path)

    # Tag release (master/develop)
    use_versioning = image.get('use_versioning', False)
    repository = image.get('repository')
    release_tag = image.get('tag', 'latest')
    extra_args = image.get('extra_args', "")

    local("docker build {0} -t {1}:{2} {3}".format(extra_args,
                                                   image.get('name'),
                                                   release_tag,
                                                   image_path))

    if use_versioning and version:
        local("docker build {0} -t {1}:{2} {3}".format(extra_args,
                                                       repository['url'],
                                                       version,
                                                       image_path))

    local("docker tag {0}:{1} {2}:{3}".format(image['name'], release_tag,
                                              repository['url'], release_tag))