controller/registry/private.py
def publish_release(source, config, target):
    """
    Publish a new release as a Docker image

    Given a source image and dictionary of last-mile configuration,
    create a target Docker image on the registry.

    For example::

        publish_release('registry.local:5000/gabrtv/myapp:v22',
                        {'ENVVAR': 'values'},
                        'registry.local:5000/gabrtv/myapp:v23')

    results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
    contains the new configuration as ENV entries.
    """
    try:
        repo, tag = utils.parse_repository_tag(source)
        src_image = repo
        src_tag = tag if tag is not None else 'latest'

        nameparts = repo.rsplit('/', 1)
        if len(nameparts) == 2:
            if '/' in nameparts[0]:
                # strip the hostname and just use the app name
                src_image = '{}/{}'.format(nameparts[0].rsplit('/', 1)[1],
                                           nameparts[1])
            elif '.' in nameparts[0]:
                # we got a name like registry.local:5000/registry
                src_image = nameparts[1]

        target_image = target.rsplit(':', 1)[0]
        target_tag = target.rsplit(':', 1)[1]
        image_id = _get_tag(src_image, src_tag)
    except RuntimeError:
        if src_tag == 'latest':
            # no image exists yet, so let's build one!
            _put_first_image(src_image)
            image_id = _get_tag(src_image, src_tag)
        else:
            raise
    image = _get_image(image_id)
    # construct the new image
    image['parent'] = image['id']
    image['id'] = _new_id()
    config['DEIS_APP'] = target_image
    config['DEIS_RELEASE'] = target_tag
    image['config']['Env'] = _construct_env(image['config']['Env'], config)
    # update and tag the new image
    _commit(target_image, image, _empty_tar_archive(), target_tag)

    Publish a new release as a Docker image

    Given a source image and dictionary of last-mile configuration,
    create a target Docker image on the registry.

    For example::

        publish_release('registry.local:5000/gabrtv/myapp:v22',
                        {'ENVVAR': 'values'},
                        'registry.local:5000/gabrtv/myapp:v23')

    results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
    contains the new configuration as ENV entries.
    
Publish a new release as a Docker image
Given a source image and dictionary of last-mile configuration,
create a target Docker image on the registry.

For example:.



results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
contains the new configuration as ENV entries.
Publish a new release as a Docker image Given a source image and dictionary of last - mile configuration create a target Docker image on the registry . For example : . results in a new Docker image at ' registry . local : 5000 / gabrtv / myapp : v23 ' which contains the new configuration as ENV entries .
def publish_release(source, config, target):
    try:
        repo, tag = utils.parse_repository_tag(source)
        src_image = repo
        src_tag = tag if tag is not None else 'latest'
        nameparts = repo.rsplit('/', 1)
        if len(nameparts) == 2:
            if '/' in nameparts[0]:
                src_image = '{}/{}'.format(nameparts[0].rsplit('/', 1)[1],
                                           nameparts[1])
            elif '.' in nameparts[0]:
                src_image = nameparts[1]
        target_image = target.rsplit(':', 1)[0]
        target_tag = target.rsplit(':', 1)[1]
        image_id = _get_tag(src_image, src_tag)
    except RuntimeError:
        if src_tag == 'latest':
            _put_first_image(src_image)
            image_id = _get_tag(src_image, src_tag)
        else:
            raise
    image = _get_image(image_id)
    image['parent'] = image['id']
    image['id'] = _new_id()
    config['DEIS_APP'] = target_image
    config['DEIS_RELEASE'] = target_tag
    image['config']['Env'] = _construct_env(image['config']['Env'], config)
    _commit(target_image, image, _empty_tar_archive(), target_tag)
def publish_release ( source , config , target ) : try : repo , tag = utils . parse_repository_tag ( source ) src_image = repo src_tag = tag if tag is not None else 'latest' nameparts = repo . rsplit ( '/' , 1 ) if len ( nameparts ) == 2 : if '/' in nameparts [ 0 ] : src_image = '{}/{}' . format ( nameparts [ 0 ] . rsplit ( '/' , 1 ) [ 1 ] , nameparts [ 1 ] ) elif '.' in nameparts [ 0 ] : src_image = nameparts [ 1 ] target_image = target . rsplit ( ':' , 1 ) [ 0 ] target_tag = target . rsplit ( ':' , 1 ) [ 1 ] image_id = _get_tag ( src_image , src_tag ) except RuntimeError : if src_tag == 'latest' : _put_first_image ( src_image ) image_id = _get_tag ( src_image , src_tag ) else : raise image = _get_image ( image_id ) image [ 'parent' ] = image [ 'id' ] image [ 'id' ] = _new_id ( ) config [ 'DEIS_APP' ] = target_image config [ 'DEIS_RELEASE' ] = target_tag image [ 'config' ] [ 'Env' ] = _construct_env ( image [ 'config' ] [ 'Env' ] , config ) _commit ( target_image , image , _empty_tar_archive ( ) , target_tag )
Publish a new release as a Docker image
Given a source image and dictionary of last-mile configuration,
create a target Docker image on the registry.
Publish a new release as a Docker image Given a source image and dictionary of last - mile configuration create a target Docker image on the registry .
"""
    Publish a new release as a Docker image

    Given a source image and dictionary of last-mile configuration,
    create a target Docker image on the registry.

    For example::

        publish_release('registry.local:5000/gabrtv/myapp:v22',
                        {'ENVVAR': 'values'},
                        'registry.local:5000/gabrtv/myapp:v23')

    results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
    contains the new configuration as ENV entries.
    """ # strip the hostname and just use the app name # we got a name like registry.local:5000/registry # no image exists yet, so let's build one! # construct the new image # update and tag the new image
source
config
target