From c4375267244a9638b3ecef6443d061f7097f984b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Tue, 5 Dec 2023 13:43:11 +0100 Subject: [PATCH] Add first attempt --- build.gradle | 1 + .../main/java/org/opensearch/gradle/VersionProperties.java | 6 ++++++ buildSrc/version.properties | 1 + distribution/archives/build.gradle | 2 +- distribution/docker/build.gradle | 4 ++-- distribution/packages/build.gradle | 4 ++-- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 4b23a8d07dddd..6f3b1ab6d4d5d 100644 --- a/build.gradle +++ b/build.gradle @@ -76,6 +76,7 @@ allprojects { group = 'org.opensearch' version = VersionProperties.getOpenSearch() description = "OpenSearch subproject ${project.path}" + wazuhVersion = VersionProperties.getWazuh() } configure(allprojects - project(':distribution:archives:integ-test-zip')) { diff --git a/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java b/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java index 4d8b62d95dff1..48caeabe97386 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java @@ -48,6 +48,10 @@ public static String getOpenSearch() { return opensearch; } + public static String getWazuh() { + return wazuh; + } + public static Version getOpenSearchVersion() { return Version.fromString(opensearch); } @@ -89,6 +93,7 @@ public static Map getVersions() { } private static final String opensearch; + private static final String wazuh; private static final String lucene; private static final String bundledJdkDarwin; private static final String bundledJdkFreeBSD; @@ -104,6 +109,7 @@ public static Map getVersions() { static { Properties props = getVersionProperties(); opensearch = props.getProperty("opensearch"); + wazuh = props.getProperty("wazuh"); lucene = props.getProperty("lucene"); bundledJdkVendor = props.getProperty("bundled_jdk_vendor"); final String bundledJdk = props.getProperty("bundled_jdk"); diff --git a/buildSrc/version.properties b/buildSrc/version.properties index d01a6b654b3de..91185b5754d93 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -1,5 +1,6 @@ opensearch = 2.11.0 lucene = 9.7.0 +wazuh = 4.9.0 bundled_jdk_vendor = adoptium bundled_jdk = 17.0.8+7 diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index a4c95e64b7b2c..cdca98b191e00 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -35,7 +35,7 @@ apply plugin: 'opensearch.internal-distribution-archive-setup' CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, JavaPackageType java) { version = rootProject.file('VERSION').getText() return copySpec { - into("wazuh-indexer-${version}") { + into("wazuh-indexer-${wazuhVersion}") { into('lib') { with libFiles() } diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index f0641aa78d617..8736c96c2c5dc 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -60,7 +60,7 @@ ext.expansions = { Architecture architecture, DockerBase base, boolean local -> classifier = "linux-\$(arch)" } - final String opensearch = "wazuh-indexer-min-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz" + final String opensearch = "wazuh-indexer-min-${VersionProperties.getWazuh()}-${classifier}.tar.gz" /* Both the following Dockerfile commands put the resulting artifact at * the same location, regardless of classifier, so that the commands that @@ -256,7 +256,7 @@ subprojects { Project subProject -> final String exportTaskName = taskName("export", architecture, base, "DockerImage") final String buildTaskName = taskName("build", architecture, base, "DockerImage") - final String tarFile = "${parent.projectDir}/build/${artifactName}_${VersionProperties.getOpenSearch()}.${extension}" + final String tarFile = "${parent.projectDir}/build/${artifactName}_${VersionProperties.getWazuh()}.${extension}" tasks.register(exportTaskName, LoggedExec) { inputs.file("${parent.projectDir}/build/markers/${buildTaskName}.marker") diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 27b7a7bb7452a..7207c50d0b712 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -137,9 +137,9 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) { // SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself // Deb convention uses a '_' for final separator before architecture, rpm uses a '.' if (type == 'deb') { - archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min_${project.version}${jdkString}_${archString}.${type}" })) + archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min_${project.wazuhVersion}${jdkString}_${archString}.${type}" })) } else { - archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min-${project.version}${jdkString}.${archString}.${type}" })) + archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min-${project.wazuhVersion}${jdkString}.${archString}.${type}" })) } String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"