Skip to content
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

Add wazuh version as property #74

Closed
wants to merge 2 commits into from
Closed
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
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
10 changes: 8 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 Expand Up @@ -195,6 +195,12 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
}
}

// // Version file
// into('/usr/share/wazuh-indexer') {
// from(rootProject.file('VERSION'))
// fileMode 0644
// }

// license files
if (type == 'deb') {
into("/usr/share/doc/${packageName}") {
Expand Down