Select Git revision
Jenkinsfile
build.gradle 1.29 KiB
plugins {
id 'com.bmuschko.docker-remote-api' version "${docker_remote_plugin}"
}
import com.bmuschko.gradle.docker.tasks.image.*
String dockerVersion = "latest" // "$version-NEZO"
String dockerTags = "${dockerRegistryForPublish}/${project.group}/${project.name}:${dockerVersion}"
tasks.register('createDockerfile', Dockerfile) {
description = "Creates a Dockerfile for the Docs."
destFile = file("${buildDir}/Dockerfile")
from "nginx"
runCommand ("rm -rf /usr/share/nginx/html/*")
copyFile "output", "/usr/share/nginx/html"
}
tasks.register('buildImage', DockerBuildImage) {
description = "Builds a Docker Image for the Docs."
dependsOn(rootProject.buildDocs, 'createDockerfile')
inputDir = file("${buildDir}")
images.addAll(dockerTags)
registryCredentials {
url = dockerRegistryForRead
username = project.findProperty('repository_username')
password = project.findProperty('repository_password')
}
}
tasks.register('pushImage', DockerPushImage) {
description = "Pushes the Docs Docker Image to the Artifactory."
images.addAll(dockerTags)
registryCredentials {
url = dockerRegistryForPublish
username = project.findProperty('repository_username')
password = project.findProperty('repository_password')
}
}