示例#1
0
def PublishContainerSelection(publishSelection, selectionToPublish):
    composeFiles = publishSelection[BuildTools.FILES_KEY]
    publishComposeFile = BuildTools.GetAvailableComposeFilename(
        'publish', selectionToPublish)
    DockerComposeTools.MergeComposeFiles(composeFiles, publishComposeFile)

    try:
        DockerComposeTools.PublishDockerImages(publishComposeFile)
    except:
        BuildTools.RemoveComposeFileIfNotPreserved(publishComposeFile,
                                                   publishSelection)
        raise

    if BuildTools.ADDITIONAL_TAG_KEY in publishSelection:
        DockerComposeTools.PublishDockerImagesWithNewTag(
            publishComposeFile,
            publishSelection[BuildTools.ADDITIONAL_TAG_KEY])
    if BuildTools.ADDITIONAL_TAGS_KEY in publishSelection:
        for tag in publishSelection[BuildTools.ADDITIONAL_TAGS_KEY]:
            DockerComposeTools.PublishDockerImagesWithNewTag(
                publishComposeFile, tag)
    if BuildTools.COMPOSE_FILE_WITH_DIGESTS_KEY in publishSelection:
        composeFileWithDigests = publishSelection[
            BuildTools.COMPOSE_FILE_WITH_DIGESTS_KEY]
        BuildTools.GenerateComposeFileWithDigests(composeFiles,
                                                  composeFileWithDigests)

    BuildTools.RemoveComposeFileIfNotPreserved(publishComposeFile,
                                               publishSelection)
示例#2
0
def PublishContainerSelection(publishSelection, publishSelectionKey):
    composeFiles = publishSelection[BuildTools.FILES_KEY]
    publishComposeFile = 'docker-compose.publish.' + publishSelectionKey + '.yml'
    DockerComposeTools.MergeComposeFiles(composeFiles, publishComposeFile)
    DockerComposeTools.PublishDockerImages(publishComposeFile)
    if BuildTools.ADDITIONAL_TAG_KEY in publishSelection:
        DockerComposeTools.PublishDockerImagesWithNewTag(publishComposeFile, publishSelection[BuildTools.ADDITIONAL_TAG_KEY])