Skip to content

Commit

Permalink
build: finalize script to build images
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAure committed Jan 21, 2025
1 parent 702ba83 commit 5c700f0
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 147 deletions.
26 changes: 21 additions & 5 deletions dev/io.openliberty.org.testcontainers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,29 @@ task assembleTestContainerData(type: JavaExec) {
}

task generateCustomImages(type: JavaExec) {
// TODO If artifactory is available then use it for substitution
// if ( gradle.userProps.containsKey("artifactory.docker.server") ) {
// environment "TESTCONTAINERS_IMAGE_SUBSTITUTOR", "componenttest.containers.ArtifactoryMirrorSubstitutor"
// environment "IMAGE_NAME_PREFIX", gradle.userProps.getProperty("artifactory.docker.server")
// }
// If artifactory is available then use it for substitution
if ( gradle.userProps.containsKey("artifactory.docker.server") ) {
environment "TESTCONTAINERS_IMAGE_SUBSTITUTOR", "componenttest.containers.ArtifactoryMirrorSubstitutor"
environment "ARTIFACTORY_REGISTRY", gradle.userProps.getProperty("artifactory.docker.server")
}

// If custom registry is available then use it for building
if ( gradle.userProps.containsKey("docker_registry.server") ) {
environment "INTERNAL_REGISTRY", gradle.userProps.getProperty("docker_registry.server")
}

classpath = configurations.runtime.plus(sourceSets.main.runtimeClasspath)
main = "io.openliberty.org.testcontainers.generate.CustomImages"
args project.getProjectDir()

// Debugging properties for testcontainers
systemProperties = [
'org.slf4j.simpleLogger.logFile': new File(project.getProjectDir(), 'build/testcontainers.log'),
'org.slf4j.simpleLogger.showDateTime': 'true',
'org.slf4j.simpleLogger.dateTimeFormat': '[MM/dd/yyyy HH:mm:ss:SSS z]',
'org.slf4j.simpleLogger.log.org.testcontainers': 'debug',
'org.slf4j.simpleLogger.log.tc': 'debug',
'org.slf4j.simpleLogger.log.com.github.dockerjava': 'warn',
'org.slf4j.simpleLogger.log.com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire': 'off'
]
}
Loading

0 comments on commit 5c700f0

Please sign in to comment.