From f01cc2770186e89f89041797b9b5cdf011a7d2f9 Mon Sep 17 00:00:00 2001 From: Fede Tux Date: Mon, 22 Jan 2024 08:06:15 -0300 Subject: [PATCH] Get plugins using maven --- docker/ci/images/Dockerfile | 2 +- docker/dev/images/Dockerfile | 1 + scripts/assemble.sh | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/ci/images/Dockerfile b/docker/ci/images/Dockerfile index c84791adcb3e5..8704d1a25d83b 100644 --- a/docker/ci/images/Dockerfile +++ b/docker/ci/images/Dockerfile @@ -6,7 +6,7 @@ RUN mkdir /home/wazuh-indexer && \ echo "deb http://repo.aptly.info/ squeeze main" | tee -a /etc/apt/sources.list.d/aptly.list && \ apt-get update -y && \ apt-get upgrade -y && \ - apt-get install -y aptly build-essential cpio debhelper-compat debmake freeglut3 libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-dev libcairo2 libcairo2-dev libcups2 libdrm2 libgbm-dev libgconf-2-4 libnspr4 libnspr4-dev libnss3 libpangocairo-1.0-0 libxcomposite-dev libxdamage1 libxfixes-dev libxfixes3 libxi6 libxkbcommon-x11-0 libxrandr2 libxrender1 libxtst6 rpm rpm2cpio && \ + apt-get install -y aptly build-essential cpio debhelper-compat debmake freeglut3 libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-dev libcairo2 libcairo2-dev libcups2 libdrm2 libgbm-dev libgconf-2-4 libnspr4 libnspr4-dev libnss3 libpangocairo-1.0-0 libxcomposite-dev libxdamage1 libxfixes-dev libxfixes3 libxi6 libxkbcommon-x11-0 libxrandr2 libxrender1 libxtst6 rpm rpm2cpio maven && \ apt-get clean -y && \ dpkg -r lintian && \ addgroup --gid 1000 wazuh-indexer && \ diff --git a/docker/dev/images/Dockerfile b/docker/dev/images/Dockerfile index f49aa4b1aba6e..111f661b8e225 100644 --- a/docker/dev/images/Dockerfile +++ b/docker/dev/images/Dockerfile @@ -7,6 +7,7 @@ RUN gradle clean FROM eclipse-temurin:17-jdk-alpine RUN apk add git && \ + apk add curl && \ addgroup -g 1000 wazuh-indexer && \ adduser -u 1000 -G wazuh-indexer -D -h /home/wazuh-indexer wazuh-indexer && \ chmod 0775 /home/wazuh-indexer && \ diff --git a/scripts/assemble.sh b/scripts/assemble.sh index c2d419f299ff8..f94a3875961b9 100755 --- a/scripts/assemble.sh +++ b/scripts/assemble.sh @@ -214,11 +214,12 @@ function enable_performance_analyzer_rca() { # Install plugins # ==== function install_plugins() { - # Install plugins from Maven repository echo "Install plugins" + maven_repo_local="$HOME/maven" for plugin in "${plugins[@]}"; do plugin_from_maven="org.opensearch.plugin:${plugin}:$VERSION.0" - OPENSEARCH_PATH_CONF=$PATH_CONF "${PATH_BIN}/opensearch-plugin" install --batch --verbose "${plugin_from_maven}" + mvn -Dmaven.repo.local=$maven_repo_local org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=https://repo1.maven.org/maven2 -Dartifact=$plugin_from_maven:zip + OPENSEARCH_PATH_CONF=$PATH_CONF "${PATH_BIN}/opensearch-plugin" install --batch --verbose "file:${maven_repo_local}/org/opensearch/plugin/${plugin}/$VERSION.0/${plugin}-$VERSION.0.zip" done }