Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ dependencies:
condition: haproxy-ingress.install

- name: nginx-ingress-controller
version: 11.6.11
version: 11.6.13
repository: "https://charts.bitnami.com/bitnami"
condition: nginx-ingress-controller.install

- name: postgresql
version: 16.4.16
version: 16.6.3
repository: "https://charts.bitnami.com/bitnami"
condition: postgresql.install

- name: rabbitmq
version: 15.3.3
version: 15.5.1
repository: "https://charts.bitnami.com/bitnami"
condition: rabbitmq.install
91 changes: 47 additions & 44 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import com.github.gradle.node.yarn.task.YarnTask
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download
import java.io.ByteArrayOutputStream
import org.apache.commons.lang.SystemUtils.*
import java.time.Instant
import de.undercouch.gradle.tasks.download.Download
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

buildscript {
repositories {
Expand All @@ -29,12 +30,13 @@ buildscript {
}

plugins {
kotlin("jvm") version "1.8.10"
kotlin("jvm") version "2.1.20"

id("com.github.node-gradle.node") version "7.0.2"
id("idea")
id("nebula.release") version (properties["nebulaReleasePluginVersion"] as String)
id("maven-publish")
id("de.undercouch.download") version "5.6.0"
}

apply(plugin = "ai.digital.gradle-commit")
Expand All @@ -43,20 +45,21 @@ apply(plugin = "com.xebialabs.dependency")
group = "ai.digital.deploy.helm"
project.defaultTasks = listOf("build")

val languageLevel = properties["languageLevel"] as String
val helmVersion = properties["helmVersion"]
val operatorSdkVersion = properties["operatorSdkVersion"]
val openshiftPreflightVersion = properties["openshiftPreflightVersion"]
val kustomizeVersion = properties["kustomizeVersion"]
val operatorBundleChannels = properties["operatorBundleChannels"]
val operatorBundleDefaultChannel = properties["operatorBundleDefaultChannel"]

val os = detectOs()
val arch = detectHostArch()
val currentTime = Instant.now().toString()
val releaseRepository = System.getenv()["RELEASE_REGISTRY"] ?: "xebialabsunsupported"
val dockerHubRepository = System.getenv()["DOCKER_HUB_REPOSITORY"] ?: releaseRepository
val releasedVersion = System.getenv()["RELEASE_EXPLICIT"] ?: "25.1.0-${
LocalDateTime.now().format(DateTimeFormatter.ofPattern("Mdd.Hmm"))
}"
val releasedVersion = System.getenv()["RELEASE_EXPLICIT"] ?:
"${project.version}-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("Mdd.Hmm"))}"
project.extra.set("releasedVersion", releasedVersion)
val releasedAppVersion = System.getenv()["RELEASE_APP_EXPLICIT"] ?: releasedVersion
project.extra.set("releasedAppVersion", releasedAppVersion)
Expand Down Expand Up @@ -119,8 +122,8 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.toVersion(languageLevel)
targetCompatibility = JavaVersion.toVersion(languageLevel)
withSourcesJar()
withJavadocJar()
}
Expand All @@ -136,11 +139,11 @@ tasks.withType<AbstractPublishToMaven> {
tasks {

compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(languageLevel))
}

compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(languageLevel))
}

val operatorImageUrl = "docker.io/$dockerHubRepository/deploy-operator:$releasedVersion"
Expand Down Expand Up @@ -170,9 +173,9 @@ tasks {
copy {
from(tarTree(helmDir.file("helm.tar.gz")))
into(helmDir)
fileMode = 0b111101101
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'setter for fileMode: Int?' is deprecated. Deprecated in Java

filePermissions { unix("rwxr-xr-x") }
}
exec {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exec(Action): ExecResult' is deprecated. This method will be removed in Gradle 9.0. Use ExecOperations.exec(Action) or ProviderFactory.exec(Action) instead.

project.exec {
workingDir(helmDir)
commandLine(helmCli, "version")
}
Expand All @@ -187,9 +190,9 @@ tasks {
copy {
from(operatorSdkDir.dir("operator-sdk-tool").file("operator-sdk"))
into(operatorSdkDir)
fileMode = 0b111101101
filePermissions { unix("rwxr-xr-x") }
}
exec {
project.exec {
workingDir(operatorSdkDir)
commandLine(operatorSdkCli, "version")
}
Expand All @@ -205,9 +208,9 @@ tasks {
copy {
from(openshiftPreflightDir.dir("install").file("openshift-preflight"))
into(openshiftPreflightDir)
fileMode = 0b111101101
filePermissions { unix("rwxr-xr-x") }
}
exec {
project.exec {
workingDir(openshiftPreflightDir)
commandLine(openshiftPreflightCli, "--version")
}
Expand All @@ -222,9 +225,9 @@ tasks {
copy {
from(tarTree(kustomizeDir.file("kustomize.tar.gz")))
into(kustomizeDir)
fileMode = 0b111101101
filePermissions { unix("rwxr-xr-x") }
}
exec {
project.exec {
workingDir(kustomizeDir)
commandLine(kustomizeCli, "version")
}
Expand Down Expand Up @@ -268,7 +271,7 @@ tasks {
commandLine(helmCli, "dependency", "update", ".")

doLast {
exec {
project.exec {
workingDir(buildXldOperatorDir)
commandLine("ls", "charts")
}
Expand Down Expand Up @@ -360,7 +363,7 @@ tasks {

doLast {
// config/manager/manager.yaml replace resource memory
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#memory: 128Mi#memory: 512Mi#g",
Expand Down Expand Up @@ -410,7 +413,7 @@ tasks {
copy {
from(tarTree(helmDir.file("helm.tar.gz")))
into(buildXldDir)
fileMode = 0b111101101
filePermissions { unix("rwxr-xr-x") }
}
}
}
Expand All @@ -430,21 +433,21 @@ tasks {

doFirst {
// operator/Dockerfile -> Dockerfile
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "/^FROM.*/r $sourceDockerFile",
targetDockerFile)
}
// operator/Dockerfile replace VERSION
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${VERSION}#$releasedVersion#g",
targetDockerFile)
}
// operator/watches.yaml -> watches.yaml
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "/^#.+kubebuilder:scaffold:watch.*/r $sourceWatchesFile",
Expand Down Expand Up @@ -501,93 +504,93 @@ tasks {
into(buildXldDir)
duplicatesStrategy = DuplicatesStrategy.WARN
}
exec {
project.exec {
workingDir(buildXldDir.get().dir("config/samples"))
commandLine(kustomizeCli, "edit", "add", "resource", "xld_minimal.yaml")
}
exec {
project.exec {
workingDir(buildXldDir.get().dir("config/samples"))
commandLine(kustomizeCli, "edit", "add", "resource", "xld_placeholders.yaml")
}
exec {
project.exec {
workingDir(buildXldDir.get().dir("config/default"))
commandLine(kustomizeCli, "edit", "remove", "resource", "../manager")
}
exec {
project.exec {
workingDir(buildXldDir.get().dir("config/default"))
commandLine(kustomizeCli, "edit", "add", "resource", "../custom")
}
// config/manifests/bases/xld.clusterserviceversion.yaml replace VERSION
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${VERSION}#$releasedVersion#g",
targetCsvFile)
}
// config/manifests/bases/xld.clusterserviceversion.yaml replace APP_VERSION
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${APP_VERSION}#$releasedAppVersion#g",
targetCsvFile)
}
// config/custom/manager_config_patch.yaml replace APP_VERSION
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${APP_VERSION}#$releasedAppVersion#g",
buildXldDir.get().dir("config/custom/manager_config_patch.yaml"))
}
// config/manifests/bases/xld.clusterserviceversion.yaml replace DOCKER_HUB_REPOSITORY
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${DOCKER_HUB_REPOSITORY}#$dockerHubRepository#g",
targetCsvFile)
}
// config/custom/manager_config_patch.yaml replace DOCKER_HUB_REPOSITORY
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${DOCKER_HUB_REPOSITORY}#$dockerHubRepository#g",
buildXldDir.get().dir("config/custom/manager_config_patch.yaml"))
}
// config/manifests/bases/xld.clusterserviceversion.yaml replace CONTAINER_IMAGE
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${CONTAINER_IMAGE}#$operatorImageUrl#g",
targetCsvFile)
}
// config/manifests/bases/xld.clusterserviceversion.yaml replace CURRENT_TIME
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "s#\${CURRENT_TIME}#$currentTime#g",
targetCsvFile)
}
exec {
project.exec {
workingDir(buildXldDir)
commandLine("$operatorFolder/scripts/generate_skip_versions.sh", releasedVersion, targetCsvFile)
}
}
doLast {
// bundle.Dockerfile -> bundle.Dockerfile
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "/^LABEL operators.operatorframework.io.test.config.*/r $sourceDockerFile",
targetDockerFile)
}
// annotations.yaml -> bundle/annotations.yaml
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "/^.*operators.operatorframework.io.test.config.v1.*/r $sourceAnnotationsFile",
targetAnnotationsFile)
}
// bundle/annotations.yaml remove empty lines
exec {
project.exec {
workingDir(buildXldDir)
commandLine("sed", "-i.bak",
"-e", "/^\$/d",
Expand Down Expand Up @@ -712,7 +715,7 @@ tasks {
val operatorChartDir = layout.buildDirectory.dir("xld/helm-charts/digitalai-deploy/charts")

// postgresql
val postgresqlSubchart = "postgresql-16.4.16.tgz"
val postgresqlSubchart = "postgresql-16.6.3.tgz"
val postgresqlOperatorChart = operatorChartDir.get().file(postgresqlSubchart)

register<Exec>("hotfixPostgresqlOperatorChart") {
Expand Down Expand Up @@ -745,7 +748,7 @@ tasks {
}

// rabbitmq
val rabbitmqSubchart = "rabbitmq-15.3.3.tgz"
val rabbitmqSubchart = "rabbitmq-15.5.1.tgz"
val rabbitmqOperatorChart = operatorChartDir.get().file(rabbitmqSubchart)

register<Exec>("hotfixRabbitmqOperatorChart") {
Expand Down Expand Up @@ -816,14 +819,14 @@ tasks {
doLast {
logger.lifecycle("Openshift preflight container check $deployMasterImageUrl finished")

exec {
project.exec {
workingDir(buildXldDir)
commandLine(openshiftPreflightCli, "check", "container",
deployCcImageUrl)
}
logger.lifecycle("Openshift preflight container check $deployCcImageUrl finished")

exec {
project.exec {
workingDir(buildXldDir)
commandLine(openshiftPreflightCli, "check", "container",
deployTaskEngineImageUrl)
Expand Down Expand Up @@ -878,8 +881,8 @@ publishing {
}

node {
version.set("20.14.0")
yarnVersion.set("1.22.22")
version.set(properties["nodeVersion"] as String)
yarnVersion.set(properties["yarnVersion"] as String)
download.set(true)
}

Expand Down
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#Fri Nov 03 14:55:06 CET 2023
languageLevel=17
version=25.3.0
languageLevel=21
org.gradle.parallel=true
xlDefaultsPluginVersion=3.0.1
org.gradle.caching=false
helmVersion=3.17.2
helmVersion=3.17.3
gradleCommitPluginVersion=1.0.0-202.1009
nebulaReleasePluginVersion=17.1.0
xlPluginsPluginVersion=3.0.5
operatorSdkVersion=1.39.1
operatorSdkVersion=1.39.2
kustomizeVersion=5.6.0
operatorBundleDefaultChannel=beta
openshiftPreflightVersion=1.11.1
operatorBundleChannels=beta
nodeVersion=20.14.0
yarnVersion=1.22.22
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading