Skip to content

Commit 188cad5

Browse files
f-gallandAlexRuiz7
andcommitted
Use maven for plugin download (#139)
* Fine tuning permissions on RPM spec file * Get plugins using maven * Rolling back changes to spec file * Format files --------- Co-authored-by: Álex Ruiz <[email protected]>
1 parent a705980 commit 188cad5

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

docker/ci/images/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN mkdir /home/wazuh-indexer && \
66
echo "deb http://repo.aptly.info/ squeeze main" | tee -a /etc/apt/sources.list.d/aptly.list && \
77
apt-get update -y && \
88
apt-get upgrade -y && \
9-
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 && \
9+
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 && \
1010
apt-get clean -y && \
1111
dpkg -r lintian && \
1212
addgroup --gid 1000 wazuh-indexer && \

docker/dev/images/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN gradle clean
77

88
FROM eclipse-temurin:17-jdk-alpine
99
RUN apk add git && \
10+
apk add curl && \
1011
addgroup -g 1000 wazuh-indexer && \
1112
adduser -u 1000 -G wazuh-indexer -D -h /home/wazuh-indexer wazuh-indexer && \
1213
chmod 0775 /home/wazuh-indexer && \

scripts/assemble.sh

+28-28
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,32 @@ set -ex
1414

1515
TEST=${TEST:-false}
1616

17-
if ( $TEST )
18-
then
19-
plugins=(
20-
"performance-analyzer"
21-
"opensearch-security"
22-
)
17+
if ($TEST); then
18+
plugins=(
19+
"performance-analyzer"
20+
"opensearch-security"
21+
)
2322
else
24-
plugins=(
25-
"alerting" # "opensearch-alerting"
26-
"opensearch-job-scheduler"
27-
"opensearch-anomaly-detection" # Requires "opensearch-job-scheduler"
28-
"asynchronous-search" # "opensearch-asynchronous-search"
29-
"opensearch-cross-cluster-replication"
30-
"geospatial" # "opensearch-geospatial"
31-
"opensearch-index-management"
32-
"opensearch-knn"
33-
"opensearch-ml-plugin" # "opensearch-ml"
34-
"neural-search" # "opensearch-neural-search"
35-
"opensearch-notifications-core"
36-
"notifications" # "opensearch-notifications". Requires "opensearch-notifications-core"
37-
"opensearch-observability"
38-
"performance-analyzer" # "opensearch-performance-analyzer"
39-
"opensearch-reports-scheduler"
40-
"opensearch-security"
41-
"opensearch-security-analytics"
42-
"opensearch-sql-plugin" # "opensearch-sql"
43-
)
23+
plugins=(
24+
"alerting" # "opensearch-alerting"
25+
"opensearch-job-scheduler"
26+
"opensearch-anomaly-detection" # Requires "opensearch-job-scheduler"
27+
"asynchronous-search" # "opensearch-asynchronous-search"
28+
"opensearch-cross-cluster-replication"
29+
"geospatial" # "opensearch-geospatial"
30+
"opensearch-index-management"
31+
"opensearch-knn"
32+
"opensearch-ml-plugin" # "opensearch-ml"
33+
"neural-search" # "opensearch-neural-search"
34+
"opensearch-notifications-core"
35+
"notifications" # "opensearch-notifications". Requires "opensearch-notifications-core"
36+
"opensearch-observability"
37+
"performance-analyzer" # "opensearch-performance-analyzer"
38+
"opensearch-reports-scheduler"
39+
"opensearch-security"
40+
"opensearch-security-analytics"
41+
"opensearch-sql-plugin" # "opensearch-sql"
42+
)
4443
fi
4544

4645
# ====
@@ -214,11 +213,12 @@ function enable_performance_analyzer_rca() {
214213
# Install plugins
215214
# ====
216215
function install_plugins() {
217-
# Install plugins from Maven repository
218216
echo "Install plugins"
217+
maven_repo_local="$HOME/maven"
219218
for plugin in "${plugins[@]}"; do
220219
plugin_from_maven="org.opensearch.plugin:${plugin}:$VERSION.0"
221-
OPENSEARCH_PATH_CONF=$PATH_CONF "${PATH_BIN}/opensearch-plugin" install --batch --verbose "${plugin_from_maven}"
220+
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
221+
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"
222222
done
223223
}
224224

0 commit comments

Comments
 (0)