Skip to content

Commit

Permalink
Merge pull request #2150 from wazuh/2069-compatibility-with-latest-op…
Browse files Browse the repository at this point in the history
…ensearch-version-available-to4.4

2069 compatibility with latest opensearch version available to4.4
  • Loading branch information
teddytpc1 authored Apr 4, 2023
2 parents 3144338 + 8962e2f commit aea18f9
Show file tree
Hide file tree
Showing 8 changed files with 503 additions and 453 deletions.
2 changes: 1 addition & 1 deletion stack/dashboard/base/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ revision="$2"
future="$3"
repository="$4"
reference="$5"
opensearch_version="2.4.1"
opensearch_version="2.6.0"
base_dir=/opt/wazuh-dashboard-base

# -----------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion stack/dashboard/rpm/docker/x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ RUN yum install -y openssh-clients sudo gnupg \
yum-utils epel-release redhat-rpm-config rpm-devel \
zlib zlib-devel rpm-build autoconf automake \
glibc-devel libtool perl


RUN yum install -y https://repo.ius.io/ius-release-el$(rpm -E '%{rhel}').rpm

RUN yum update -y && yum install -y python3

RUN ln -fs /usr/bin/python3.6 /usr/bin/python

# Add the scripts to build the RPM package
ADD builder.sh /usr/local/bin/builder
Expand Down
2 changes: 1 addition & 1 deletion stack/indexer/base/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ architecture="$1"
revision="$2"
future="$3"
reference="$4"
opensearch_version="2.4.1"
opensearch_version="2.6.0"
base_dir=/opt/wazuh-indexer-base

# -----------------------------------------------------------------------------
Expand Down
26 changes: 19 additions & 7 deletions stack/indexer/deb/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ deb_amd64_builder="deb_indexer_builder_amd64"
deb_builder_dockerfile="${current_path}/docker"
future="no"
base_cmd=""
build_base="yes"

trap ctrl_c INT

Expand All @@ -40,14 +41,16 @@ build_deb() {
# Copy the necessary files
cp ${current_path}/builder.sh ${dockerfile_path}

# Base generation
if [ "${future}" == "yes" ];then
base_cmd+="--future "
if [ "${build_base}" == "yes" ];then
# Base generation
if [ "${future}" == "yes" ];then
base_cmd+="--future "
fi
if [ "${reference}" ];then
base_cmd+="--reference ${reference}"
fi
../base/generate_base.sh -s ${outdir} -r ${revision} ${base_cmd}
fi
if [ "${reference}" ];then
base_cmd+="--reference ${reference}"
fi
../base/generate_base.sh -s ${outdir} -r ${revision} ${base_cmd}

# Build the Docker image
if [[ ${build_docker} == "yes" ]]; then
Expand Down Expand Up @@ -94,6 +97,7 @@ help() {
echo "Usage: $0 [OPTIONS]"
echo
echo " -a, --architecture <arch> [Optional] Target architecture of the package [amd64]."
echo " -b, --build-base <yes/no> [Optional] Build a new base or use a existing one. By default, yes."
echo " -r, --revision <rev> [Optional] Package revision. By default: 1."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch to download SPECs, not used by default."
Expand All @@ -120,6 +124,14 @@ main() {
help 1
fi
;;
"-b"|"--build-base")
if [ -n "${2}" ]; then
build_base="${2}"
shift 2
else
help 1
fi
;;
"-r"|"--revision")
if [ -n "${2}" ]; then
revision="${2}"
Expand Down
447 changes: 228 additions & 219 deletions stack/indexer/deb/debian/rules

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions stack/indexer/deb/docker/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ FROM debian:8

ENV DEBIAN_FRONTEND noninteractive

RUN echo 'Acquire::Check-Valid-Until "false";' >> /etc/apt/apt.conf && \
echo "deb http://archive.debian.org/debian jessie contrib main non-free" > /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list

RUN apt-get update && apt-get install -y --force-yes apt-utils && \
apt-get install -y --force-yes \
curl sudo wget expect gnupg build-essential \
Expand Down
26 changes: 19 additions & 7 deletions stack/indexer/rpm/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rpm_x86_builder="rpm_indexer_builder_x86"
rpm_builder_dockerfile="${current_path}/docker"
future="no"
base_cmd=""
build_base="yes"

trap ctrl_c INT

Expand All @@ -42,14 +43,16 @@ build_rpm() {
# Copy the necessary files
cp ${current_path}/builder.sh ${dockerfile_path}

# Base generation
if [ "${future}" == "yes" ];then
base_cmd+="--future "
if [ "${build_base}" == "yes" ];then
# Base generation
if [ "${future}" == "yes" ];then
base_cmd+="--future "
fi
if [ "${reference}" ];then
base_cmd+="--reference ${reference}"
fi
../base/generate_base.sh -s ${outdir} -r ${revision} ${base_cmd}
fi
if [ "${reference}" ];then
base_cmd+="--reference ${reference}"
fi
../base/generate_base.sh -s ${outdir} -r ${revision} ${base_cmd}

# Build the Docker image
if [[ ${build_docker} == "yes" ]]; then
Expand Down Expand Up @@ -95,6 +98,7 @@ help() {
echo "Usage: $0 [OPTIONS]"
echo
echo " -a, --architecture <arch> [Optional] Target architecture of the package [x86_64]."
echo " -b, --build-base <yes/no> [Optional] Build a new base or use a existing one. By default, yes."
echo " -r, --revision <rev> [Optional] Package revision. By default: 1."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch to download SPECs, not used by default."
Expand All @@ -121,6 +125,14 @@ main() {
help 1
fi
;;
"-b"|"--build-base")
if [ -n "${2}" ]; then
build_base="${2}"
shift 2
else
help 1
fi
;;
"-r"|"--revision")
if [ -n "$2" ]; then
revision="$2"
Expand Down
Loading

0 comments on commit aea18f9

Please sign in to comment.