コード例 #1
0
ファイル: loader.py プロジェクト: rmoorman/ship
def verify(loader_image):
    if not get_tag():
        raise Exception('{} is empty.'.format(TAG_PATH))

    has_loader_image = False
    for image in get_images():
        if ':' in image:
            raise Exception('Image name "{}" has a colon.'.format(image))
        if image == loader_image:
            has_loader_image = True

    if not has_loader_image:
        raise Exception('{} contains no Loader image {}'.format(CRANE_YML_PATH, loader_image))
コード例 #2
0
def verify(loader_image):
    if not get_tag():
        raise Exception('{} is empty.'.format(TAG_PATH))

    has_loader_image = False
    for image in get_images():
        if ':' in image:
            raise Exception('Image name "{}" has a colon.'.format(image))
        if image == loader_image:
            has_loader_image = True

    if not has_loader_image:
        raise Exception('{} contains no Loader image {}'.format(
            CRANE_YML_PATH, loader_image))
コード例 #3
0
ファイル: loader.py プロジェクト: rmoorman/ship
def load(repo_file, tag_file, target_file):

    # Verify that tag file content matches our own tag
    tag = get_tag()
    with open(tag_file) as f:
        tag_from_file = f.read().strip()
        # Use no tag if the provided file is empty
        if not tag_from_file:
            tag = ''
        if tag != tag_from_file:
            raise Exception("ERROR: Tag file content '{}' differs from the Loader's tag '{}'."
                            " Please check sanity of the sail script.".format(tag_from_file, tag))

    with open(repo_file) as f:
        repo = f.read().strip()
    with open(target_file) as f:
        target = f.read().strip()

    modify_yaml(repo, tag)
    call_crane('run', target)
    start(repo, target, repo_file, tag_file, target_file, tag)
コード例 #4
0
def load(repo_file, tag_file, target_file):

    # Verify that tag file content matches our own tag
    tag = get_tag()
    with open(tag_file) as f:
        tag_from_file = f.read().strip()
        # Use no tag if the provided file is empty
        if not tag_from_file:
            tag = ''
        if tag != tag_from_file:
            raise Exception(
                "ERROR: Tag file content '{}' differs from the Loader's tag '{}'."
                " Please check sanity of the sail script.".format(
                    tag_from_file, tag))

    with open(repo_file) as f:
        repo = f.read().strip()
    with open(target_file) as f:
        target = f.read().strip()

    modify_yaml(repo, tag)
    call_crane('run', target)
    start(repo, target, repo_file, tag_file, target_file, tag)