forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
That will do for now
- Loading branch information
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# build files | ||
artifacts/ | ||
|
||
# intellij files | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
build-idea/ | ||
out/ | ||
|
||
# include shared intellij config | ||
!.idea/inspectionProfiles/Project_Default.xml | ||
!.idea/runConfigurations/Debug_OpenSearch.xml | ||
!.idea/vcs.xml | ||
|
||
# These files are generated in the main tree by annotation processors | ||
benchmarks/src/main/generated/* | ||
benchmarks/bin/* | ||
benchmarks/build-eclipse-default/* | ||
server/bin/* | ||
server/build-eclipse-default/* | ||
test/framework/build-eclipse-default/* | ||
|
||
# eclipse files | ||
.project | ||
.classpath | ||
.settings | ||
build-eclipse/ | ||
|
||
# netbeans files | ||
nb-configuration.xml | ||
nbactions.xml | ||
|
||
# gradle stuff | ||
.gradle/ | ||
build/ | ||
|
||
# vscode stuff | ||
.vscode/ | ||
|
||
# testing stuff | ||
**/.local* | ||
.vagrant/ | ||
/logs/ | ||
|
||
# osx stuff | ||
.DS_Store | ||
|
||
# default folders in which the create_bwc_index.py expects to find old es versions in | ||
/backwards | ||
/dev-tools/backwards | ||
|
||
# needed in case docs build is run...maybe we can configure doc build to generate files under build? | ||
html_docs | ||
|
||
# random old stuff that we should look at the necessity of... | ||
/tmp/ | ||
eclipse-build | ||
|
||
# projects using testfixtures | ||
testfixtures_shared/ | ||
|
||
# These are generated from .ci/jobs.t | ||
.ci/jobs/ | ||
|
||
# build files generated | ||
doc-tools/missing-doclet/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# ========= | ||
# 1st approach | ||
# ========= | ||
# I ran the script from my host machine .It failed due to Javadoc not being | ||
# installed in my machine | ||
# ========= | ||
# bash scripts/build.sh -v 2.11.0 -s false -p linux -a x64 -d rpm | ||
|
||
|
||
# ========= | ||
# 2nd approach | ||
# ========= | ||
# Use a Docker container. It worked and the rpm package was created | ||
# ========= | ||
# docker run -ti --rm \ | ||
# -v .:/usr/share/opensearch \ | ||
# -w /usr/share/opensearch \ | ||
# eclipse-temurin:17 \ | ||
# bash scripts/build.sh -v 2.11.0 -s false -p linux -a x64 -d rpm | ||
|
||
|
||
# ========= | ||
# 3rd approach | ||
# ========= | ||
# Dockerfile | ||
# ========= | ||
# docker build -t wazuh-indexer-builder:4.9.0 . | ||
# docker run wazuh-indexer-builder:4.9.0 | ||
# docker run wazuh-indexer-builder:4.9.0 -v 2.11.0 -s false -p linux -a x64 -d rpm | ||
# docker run -v .:/usr/share/opensearch wazuh-indexer-builder:4.9.0 -v 2.11.0 -s false -p linux -a x64 -d rpm | ||
|
||
# mkdir wazuh-indexer-packages | ||
# cd wazuh-indexer-packages | ||
# docker run -v .:/usr/share/opensearch/artifacts wazuh-indexer-builder:4.9.0 | ||
|
||
|
||
FROM eclipse-temurin:17 AS builder | ||
|
||
# USER 1000:1000 | ||
|
||
ENV JAVA_HOME=/opt/java/openjdk | ||
|
||
# Probably better to use a volume | ||
COPY . /usr/share/opensearch | ||
|
||
WORKDIR /usr/share/opensearch | ||
|
||
CMD ["-v", "2.11.0", "-s", "false", "-p", "linux", "-a", "x64", "-d", "tar"] | ||
|
||
ENTRYPOINT [ "bash", "scripts/build.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Attaches the project as a volume to a JDK 17 container | ||
# Requires Docker | ||
# Script usage: bash scripts/docker.sh | ||
|
||
set -e | ||
|
||
# Check the script is being run from the root of the project | ||
if [ ! -f "./scripts/docker.sh" ]; then | ||
echo "Please run this script from the root of the project" | ||
echo "Example: bash scripts/docker.sh" | ||
exit 1 | ||
fi | ||
|
||
# ==== | ||
# Start the container | ||
# ==== | ||
run_docker() { | ||
docker run -ti --rm \ | ||
-v .:/usr/share/opensearch \ | ||
-w /usr/share/opensearch \ | ||
--name wi-dev \ | ||
eclipse-temurin:17 \ | ||
bash | ||
} | ||
|
||
run_docker |