Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ buildscript {
javaSourceCompatibility = 8
}
ext['logback.version'] = '1.2.13'
ext['tomcat.version'] = '9.0.117'
ext['json-path.version'] = '2.10.0'
ext['json-smart.version'] = '2.6.0'
dependencies { classpath "com.blackduck.integration:common-gradle-plugin:${managedCgpVersion}" }

dependencies {
Expand Down Expand Up @@ -58,6 +61,7 @@ apply plugin: 'com.blackduck.integration.solution'
def linuxFlavorsDpkg = ["debian:11"] // the image is still named "ubuntu"
def linuxFlavorsRpm = ["fedora:41"] // the image is still named "centos"
def linuxFlavorsApk = ["alpine:latest"]
def apkBaseImage = "artifactory.tools.duckutil.net:5010/blackduck.com/chainguard-base:latest"
def linuxFlavors = linuxFlavorsDpkg + linuxFlavorsRpm + linuxFlavorsApk

String blackduckDir = "/opt/blackduck"
Expand All @@ -81,7 +85,7 @@ ext['log4j2.version'] = '2.16.0'

dependencies {

implementation 'com.blackduck.integration:hub-imageinspector-lib:15.0.4'
implementation 'com.blackduck.integration:hub-imageinspector-lib:15.0.5'

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation("org.springframework.boot:spring-boot-starter-actuator")
Expand All @@ -99,6 +103,12 @@ dependencies {
testImplementation 'io.fabric8:kubernetes-model:2.0.8'
}

dependencyManagement {
imports {
mavenBom "com.fasterxml.jackson:jackson-bom:2.18.6"
}
}

// Prepare test config file
// System.getProperty("user.dir")
task buildKubeTestPodConfig(type: Copy) {
Expand All @@ -116,9 +126,10 @@ task createApkDockerfileTasks() {
task "create${linuxFlavorDirName}Dockerfile"(type: Dockerfile) {
destFile = project.file("${buildDir}/images/${linuxFlavorDirName}/${appName}/Dockerfile")
logger.lifecycle("destFile: ${destFile}")
from linuxFlavor
from apkBaseImage
user 'root'
exposePort 8080
runCommand 'apk update && apk add bash && apk add openjdk11-jre'
runCommand 'apk update && apk add bash && apk add openjdk-11-jre'
runCommand "mkdir -p ${imagePgmDir}/shared/target"
runCommand "mkdir -p ${imagePgmDir}/shared/output"
addFile("${appName}-${version}.jar", "${imagePgmDir}/${appName}.jar")
Expand Down Expand Up @@ -273,7 +284,8 @@ task createPushTasks() {
throw new GradleException("INTERNAL_DOCKER_REGISTRY environment variable is required but not set.")
}

String [] dockerRegistries = version.contains("SNAPSHOT") ? [internalDockerRegistry] : ["docker.io", internalDockerRegistry]
// String [] dockerRegistries = version.contains("SNAPSHOT") ? [internalDockerRegistry] : ["docker.io", internalDockerRegistry]
String [] dockerRegistries = ["docker.io", internalDockerRegistry]

for (String registry : dockerRegistries) {
logger.lifecycle("Pushing image ${tagWithoutRegistry} to registry ${registry}")
Expand Down