2023-03-04 12:19:01 +00:00
|
|
|
ext {
|
2023-09-23 09:01:43 +00:00
|
|
|
dockerImage='openjdk:21-slim'
|
2023-03-04 12:19:01 +00:00
|
|
|
}
|
|
|
|
|
2023-03-12 09:04:48 +00:00
|
|
|
tasks.register('dockerFile') {
|
|
|
|
buildDir.mkdir()
|
2023-03-11 11:13:53 +00:00
|
|
|
|
2023-03-12 09:04:48 +00:00
|
|
|
var df = new File(buildDir, "Dockerfile")
|
|
|
|
doLast {
|
|
|
|
df.text = """#
|
2023-03-04 12:19:01 +00:00
|
|
|
# I'm auto-generated, please don't make changes to me or commit me to git
|
|
|
|
#
|
|
|
|
# The template exists in docker-service.gradle
|
|
|
|
#
|
|
|
|
FROM ${dockerImage}
|
|
|
|
|
2024-01-11 11:40:03 +00:00
|
|
|
RUN apt-get update && apt-get install -y curl
|
2023-03-04 12:19:01 +00:00
|
|
|
ADD ${application.applicationName}.tar /
|
|
|
|
RUN mkdir /wmsa
|
|
|
|
|
|
|
|
ENTRYPOINT WMSA_HOME=/wmsa /${application.applicationName}/bin/${application.applicationName} \${arg0} \${arg1}
|
|
|
|
"""
|
2023-03-12 09:04:48 +00:00
|
|
|
}
|
|
|
|
it.outputs.file(df)
|
|
|
|
}
|
|
|
|
|
|
|
|
dockerPrepare {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
}
|
2023-03-10 16:16:44 +00:00
|
|
|
|
2023-03-12 09:04:48 +00:00
|
|
|
dockerfileZip {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
docker {
|
|
|
|
dockerfile = tasks.dockerFile.outputs.files.singleFile
|
2023-11-16 20:12:55 +00:00
|
|
|
|
2023-11-18 12:25:46 +00:00
|
|
|
var registry = project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia'
|
|
|
|
var tagName = project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest'
|
|
|
|
|
|
|
|
name = registry+'/'+application.applicationName+':'+tagName
|
|
|
|
tag 'test', (registry+'/'+application.applicationName+':'+tagName)
|
|
|
|
|
2023-03-04 12:19:01 +00:00
|
|
|
files tasks.distTar.outputs
|
|
|
|
dependsOn tasks.distTar
|
|
|
|
}
|