All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.digital.integration.server.util.DockerComposeUtil.groovy Maven / Gradle / Ivy

The newest version!
package ai.digital.integration.server.util

import org.gradle.api.Project

import java.nio.file.Path
import java.nio.file.Paths

import static ai.digital.integration.server.constant.PluginConstant.DIST_DESTINATION_NAME

class DockerComposeUtil {

    static def dockerComposeFileDestination(Project project, String composeFileName) {
        Paths.get(
                "${project.buildDir.toPath().resolve(DIST_DESTINATION_NAME).toAbsolutePath().toString()}/${composeFileName}")
    }

    static def dockerfileDestination(Project project, String filename) {
        Paths.get(
                "${project.buildDir.toPath().resolve(DIST_DESTINATION_NAME).toAbsolutePath().toString()}/${filename}")
    }

    static def getResolvedDockerPath(Project project, String relativePath) {
        def dockerComposeStream = DockerComposeUtil.class.classLoader.getResourceAsStream(relativePath)
        Path resultComposeFilePath = dockerComposeFileDestination(project, relativePath)
        FileUtil.copyFile(dockerComposeStream, resultComposeFilePath)
        resultComposeFilePath
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy