From 3a9a8c22045494c5f8385918d31d3335a662d896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Tue, 5 Dec 2023 12:38:29 +0100 Subject: [PATCH] Include VERSION file into packages --- distribution/archives/build.gradle | 5 ++++- distribution/build.gradle | 7 +++++++ distribution/packages/build.gradle | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 161b8008525b4..eaecdb2a49dac 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -34,7 +34,7 @@ apply plugin: 'opensearch.internal-distribution-archive-setup' CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, JavaPackageType java) { return copySpec { - into("opensearch-${version}") { + into("wazuh-indexer-${version}") { into('lib') { with libFiles() } @@ -71,6 +71,9 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla pluginsDir.getParent() } } + into('') { + with versionFile() + } from(rootProject.projectDir) { include 'README.md' } diff --git a/distribution/build.gradle b/distribution/build.gradle index f7923ce0aa6b9..8a2bd5b2a56a3 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -357,6 +357,13 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { } } + versionFile = { + copySpec { + from(rootProject.file('VERSION')) + fileMode 0644 + } + } + modulesFiles = { platform -> copySpec { eachFile { diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 56e2afbdbf659..bdd77e89627ce 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -173,6 +173,9 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) { with jdkFiles(project, 'linux', architecture) } } + into ('') { + with versionFile() + } // we need to specify every intermediate directory in these paths so the package managers know they are explicitly // intended to manage them; otherwise they may be left behind on uninstallation. duplicate calls of the same // directory are fine @@ -191,6 +194,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}") {