Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use maven for plugin download #139

Merged
merged 4 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/ci/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
1 change: 1 addition & 0 deletions docker/dev/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
56 changes: 28 additions & 28 deletions scripts/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,32 @@ set -ex

TEST=${TEST:-false}

if ( $TEST )
then
plugins=(
"performance-analyzer"
"opensearch-security"
)
if ($TEST); then
plugins=(
"performance-analyzer"
"opensearch-security"
)
else
plugins=(
"alerting" # "opensearch-alerting"
"opensearch-job-scheduler"
"opensearch-anomaly-detection" # Requires "opensearch-job-scheduler"
"asynchronous-search" # "opensearch-asynchronous-search"
"opensearch-cross-cluster-replication"
"geospatial" # "opensearch-geospatial"
"opensearch-index-management"
"opensearch-knn"
"opensearch-ml-plugin" # "opensearch-ml"
"neural-search" # "opensearch-neural-search"
"opensearch-notifications-core"
"notifications" # "opensearch-notifications". Requires "opensearch-notifications-core"
"opensearch-observability"
"performance-analyzer" # "opensearch-performance-analyzer"
"opensearch-reports-scheduler"
"opensearch-security"
"opensearch-security-analytics"
"opensearch-sql-plugin" # "opensearch-sql"
)
plugins=(
"alerting" # "opensearch-alerting"
"opensearch-job-scheduler"
"opensearch-anomaly-detection" # Requires "opensearch-job-scheduler"
"asynchronous-search" # "opensearch-asynchronous-search"
"opensearch-cross-cluster-replication"
"geospatial" # "opensearch-geospatial"
"opensearch-index-management"
"opensearch-knn"
"opensearch-ml-plugin" # "opensearch-ml"
"neural-search" # "opensearch-neural-search"
"opensearch-notifications-core"
"notifications" # "opensearch-notifications". Requires "opensearch-notifications-core"
"opensearch-observability"
"performance-analyzer" # "opensearch-performance-analyzer"
"opensearch-reports-scheduler"
"opensearch-security"
"opensearch-security-analytics"
"opensearch-sql-plugin" # "opensearch-sql"
)
fi

# ====
Expand Down Expand Up @@ -214,11 +213,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
}

Expand Down