From 9b6a5104fe2c17b8ee010f5718984a23c501b977 Mon Sep 17 00:00:00 2001 From: Fede Tux Date: Thu, 11 Jan 2024 15:07:27 -0300 Subject: [PATCH] Download wazuh-template.json from wazuh/wazuh repo --- .gitignore | 5 ++++- scripts/build.sh | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 36172e2b263aa..13c0ba149b575 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,7 @@ testfixtures_shared/ .ci/jobs/ # build files generated -doc-tools/missing-doclet/bin/ \ No newline at end of file +doc-tools/missing-doclet/bin/ + +# Wazuh template (currently downloaded from the wazuh/wazuh repo directly) +distribution/src/config/wazuh-template.json diff --git a/scripts/build.sh b/scripts/build.sh index 92e1995e57e04..d4d1644356afb 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -54,6 +54,9 @@ while getopts ":h:v:q:s:o:p:a:d:r:" arg; do r) REVISION=$OPTARG ;; + b) + BRANCH=$OPTARG + ;; :) echo "Error: -${OPTARG} requires an argument" usage @@ -96,6 +99,7 @@ cp -r ./build/local-test-repo/org/opensearch "${OUTPUT}"/maven/org [ -z "$ARCHITECTURE" ] && ARCHITECTURE=$(uname -m) [ -z "$DISTRIBUTION" ] && DISTRIBUTION="tar" [ -z "$REVISION" ] && REVISION="1" +[ -z "$BRANCH" ] && BRANCH="master" case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in linux-tar-x64|darwin-tar-x64) @@ -162,6 +166,9 @@ esac echo "Building OpenSearch for $PLATFORM-$DISTRIBUTION-$ARCHITECTURE" + +wget -q https://raw.githubusercontent.com/wazuh/wazuh/$BRANCH/extensions/elasticsearch/7.x/wazuh-template.json -O distribution/src/config/wazuh-template.json + ./gradlew ":distribution:$TYPE:$TARGET:assemble" -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier="$QUALIFIER" # Copy artifact to dist folder in bundle build output