sregistry/main/google_build/push.py
def push(self, path, name, tag=None):
    '''push an image to Google Cloud Storage, meaning uploading it
    
    path: should correspond to an absolte image path (or derive it)
    name: should be the complete uri that the user has requested to push.
    tag: should correspond with an image tag. This is provided to mirror Docker
    '''
    path = os.path.abspath(path)
    bot.debug("PUSH %s" % path)

    if not os.path.exists(path):
        bot.error('%s does not exist.' %path)
        sys.exit(1)


    # This returns a data structure with collection, container, based on uri
    names = parse_image_name(remove_uri(name),tag=tag)

    if names['version'] is None:
        version = get_image_hash(path)
        names = parse_image_name(remove_uri(name), tag=tag, version=version)    

    # Update metadata with names
    metadata = self.get_metadata(path, names=names)
    if "data" in metadata:
        metadata = metadata['data']
    metadata.update(names)

    manifest = self._upload(source=path, 
                            destination=names['storage'],
                            metadata=metadata)

    print(manifest['mediaLink'])
def push(self, path, name, tag=None):
    '''push an image to Google Cloud Storage, meaning uploading it
    
    path: should correspond to an absolte image path (or derive it)
    name: should be the complete uri that the user has requested to push.
    tag: should correspond with an image tag. This is provided to mirror Docker
    '''
    path = os.path.abspath(path)
    bot.debug("PUSH %s" % path)

    if not os.path.exists(path):
        bot.error('%s does not exist.' %path)
        sys.exit(1)


    # This returns a data structure with collection, container, based on uri
    names = parse_image_name(remove_uri(name),tag=tag)

    if names['version'] is None:
        version = get_image_hash(path)
        names = parse_image_name(remove_uri(name), tag=tag, version=version)    

    # Update metadata with names
    metadata = self.get_metadata(path, names=names)
    if "data" in metadata:
        metadata = metadata['data']
    metadata.update(names)

    manifest = self._upload(source=path, 
                            destination=names['storage'],
                            metadata=metadata)

    print(manifest['mediaLink'])
def push ( self , path , name , tag = None ) : path = os . path . abspath ( path ) bot . debug ( "PUSH %s" % path ) if not os . path . exists ( path ) : bot . error ( '%s does not exist.' % path ) sys . exit ( 1 ) # This returns a data structure with collection, container, based on uri names = parse_image_name ( remove_uri ( name ) , tag = tag ) if names [ 'version' ] is None : version = get_image_hash ( path ) names = parse_image_name ( remove_uri ( name ) , tag = tag , version = version ) # Update metadata with names metadata = self . get_metadata ( path , names = names ) if "data" in metadata : metadata = metadata [ 'data' ] metadata . update ( names ) manifest = self . _upload ( source = path , destination = names [ 'storage' ] , metadata = metadata ) print ( manifest [ 'mediaLink' ] )
push an image to Google Cloud Storage, meaning uploading it
    
    path: should correspond to an absolte image path (or derive it)
    name: should be the complete uri that the user has requested to push.
    tag: should correspond with an image tag. This is provided to mirror Docker
push an image to Google Cloud Storage meaning uploading it path : should correspond to an absolte image path ( or derive it ) name : should be the complete uri that the user has requested to push . tag : should correspond with an image tag . This is provided to mirror Docker