-
Notifications
You must be signed in to change notification settings - Fork 0
Fixing incompatibilities and warnings in build #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
d-venkat
wants to merge
7
commits into
master
Choose a base branch
from
S-119432-warnings
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8fcb3b4
S-119432 Support for java 21 for all builds
vpugar-digital cbac7d0
S-119432 fix kotlin plugin setup
vpugar-digital c8663c1
D-39559 bump helm version
vpugar-digital 1500694
S-120226 Bump version of postgresql and rabbitmq helm charts
vpugar-digital 32e330e
S-120434 set com.redhat.openshift.versions field for certified operator
vpugar-digital 64e24d4
S-119432 refactor project and java versions to properties
d-venkat a3cda26
Fixing incompatibilities and warnings in build
d-venkat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
@@ -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") | ||
|
@@ -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) | ||
|
@@ -119,8 +122,8 @@ dependencies { | |
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
sourceCompatibility = JavaVersion.toVersion(languageLevel) | ||
targetCompatibility = JavaVersion.toVersion(languageLevel) | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
@@ -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" | ||
|
@@ -170,9 +173,9 @@ tasks { | |
copy { | ||
from(tarTree(helmDir.file("helm.tar.gz"))) | ||
into(helmDir) | ||
fileMode = 0b111101101 | ||
filePermissions { unix("rwxr-xr-x") } | ||
} | ||
exec { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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") | ||
} | ||
|
@@ -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") | ||
} | ||
|
@@ -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") | ||
} | ||
|
@@ -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") | ||
} | ||
|
@@ -268,7 +271,7 @@ tasks { | |
commandLine(helmCli, "dependency", "update", ".") | ||
|
||
doLast { | ||
exec { | ||
project.exec { | ||
workingDir(buildXldOperatorDir) | ||
commandLine("ls", "charts") | ||
} | ||
|
@@ -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", | ||
|
@@ -410,7 +413,7 @@ tasks { | |
copy { | ||
from(tarTree(helmDir.file("helm.tar.gz"))) | ||
into(buildXldDir) | ||
fileMode = 0b111101101 | ||
filePermissions { unix("rwxr-xr-x") } | ||
} | ||
} | ||
} | ||
|
@@ -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", | ||
|
@@ -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", | ||
|
@@ -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") { | ||
|
@@ -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") { | ||
|
@@ -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) | ||
|
@@ -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) | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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