Skip to content

Commit

Permalink
Add first attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Dec 7, 2023
1 parent f329f84 commit 9da5944
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public static String getOpenSearch() {
return opensearch;
}

public static String getWazuh() {
return wazuh;
}

public static Version getOpenSearchVersion() {
return Version.fromString(opensearch);
}
Expand Down Expand Up @@ -89,6 +93,7 @@ public static Map<String, String> 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;
Expand All @@ -104,6 +109,7 @@ public static Map<String, String> 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");
Expand Down
1 change: 1 addition & 0 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 9da5944

Please sign in to comment.