2023-10-19 17:47:38 +02:00
|
|
|
ext {
|
|
|
|
dockerImage='openjdk:21-slim'
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('dockerFile') {
|
|
|
|
buildDir.mkdir()
|
|
|
|
|
|
|
|
var df = new File(buildDir, "Dockerfile")
|
|
|
|
doLast {
|
|
|
|
df.text = """#
|
|
|
|
# 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 12:40:03 +01:00
|
|
|
RUN apt-get update && apt-get install -y curl
|
|
|
|
|
2023-10-19 17:47:38 +02:00
|
|
|
ADD ${application.applicationName}.tar /
|
|
|
|
ADD crawler-process.tar /dist
|
|
|
|
ADD loader-process.tar /dist
|
|
|
|
ADD converter-process.tar /dist
|
|
|
|
ADD website-adjacencies-calculator.tar /dist
|
|
|
|
ADD index-construction-process.tar /dist
|
|
|
|
|
|
|
|
RUN mkdir /wmsa
|
|
|
|
|
|
|
|
ENTRYPOINT WMSA_HOME=/wmsa /${application.applicationName}/bin/${application.applicationName} \${arg0} \${arg1}
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
it.outputs.file(df)
|
|
|
|
}
|
|
|
|
|
|
|
|
dockerPrepare {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
|
|
|
|
dependsOn project(':code:processes:website-adjacencies-calculator').distTar
|
|
|
|
dependsOn project(':code:processes:crawling-process').distTar
|
|
|
|
dependsOn project(':code:processes:loading-process').distTar
|
|
|
|
dependsOn project(':code:processes:converting-process').distTar
|
|
|
|
dependsOn project(':code:processes:index-constructor-process').distTar
|
|
|
|
}
|
|
|
|
|
|
|
|
dockerfileZip {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
}
|
|
|
|
|
|
|
|
docker {
|
|
|
|
dockerfile = tasks.dockerFile.outputs.files.singleFile
|
2023-11-16 21:12:55 +01:00
|
|
|
|
2023-11-18 13:25:46 +01: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-11-16 21:12:55 +01:00
|
|
|
|
2023-10-19 17:47:38 +02:00
|
|
|
files tasks.distTar.outputs, \
|
|
|
|
project(':code:processes:crawling-process').distTar.outputs, \
|
|
|
|
project(':code:processes:loading-process').distTar.outputs, \
|
|
|
|
project(':code:processes:converting-process').distTar.outputs, \
|
|
|
|
project(':code:processes:index-constructor-process').distTar.outputs, \
|
|
|
|
project(':code:processes:website-adjacencies-calculator').distTar.outputs
|
|
|
|
|
|
|
|
dependsOn project(':code:processes:crawling-process').distTar
|
|
|
|
dependsOn project(':code:processes:loading-process').distTar
|
|
|
|
dependsOn project(':code:processes:converting-process').distTar
|
|
|
|
dependsOn project(':code:processes:index-constructor-process').distTar
|
|
|
|
dependsOn project(':code:processes:website-adjacencies-calculator').distTar
|
|
|
|
}
|