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.
Get Wazuh version from VERSION file (#122)
* Add function to look for VERSION in the correct path * Update assemble.sh Adds wget as dependency * Download files using curl instead of wget * Update assemble.sh Revert assembly with minimal plugins for testing Signed-off-by: Álex Ruiz <[email protected]> * Add Dockerfile and docker-compose for the package assembly stage * Assemble packages with minimal plugin set when "test" variable is set to "true" * Update README with assemble.sh docker image * Fixing env variable naming convention and removing wget dependency * Improve Docker environments Adds environments to build packages * Fix small typos * More fixes * Add documentation * Adding -p flag to mkdir so it doesnt fail when the folder is already present * Format files --------- Signed-off-by: Álex Ruiz <[email protected]> Co-authored-by: Álex Ruiz <[email protected]>
- Loading branch information
Showing
13 changed files
with
283 additions
and
121 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
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,62 @@ | ||
#!/bin/bash | ||
|
||
# Start container with required tools to build packages | ||
# Requires Docker | ||
# Script usage: bash ./ci.sh | ||
|
||
set -e | ||
|
||
# ==== | ||
# Checks that the script is run from the intended location | ||
# ==== | ||
function check_project_root_folder() { | ||
current=$(basename "$(pwd)") | ||
|
||
if [[ "$0" != "./ci.sh" && "$0" != "ci.sh" ]]; then | ||
echo "Run the script from its location" | ||
usage | ||
exit 1 | ||
fi | ||
# Change working directory to the root of the repository | ||
cd ../.. | ||
} | ||
|
||
# ==== | ||
# Displays usage | ||
# ==== | ||
function usage() { | ||
echo "Usage: ./ci.sh {up|down|stop}" | ||
} | ||
|
||
# ==== | ||
# Main function | ||
# ==== | ||
function main() { | ||
check_project_root_folder "$@" | ||
compose_file="docker/${current}/ci.yml" | ||
compose_cmd="docker compose -f $compose_file" | ||
REPO_PATH=$(pwd) | ||
VERSION=$(cat VERSION) | ||
export REPO_PATH | ||
export VERSION | ||
|
||
case $1 in | ||
up) | ||
# Main folder created here to grant access to both containers | ||
mkdir -p artifacts | ||
$compose_cmd up -d | ||
;; | ||
down) | ||
$compose_cmd down | ||
;; | ||
stop) | ||
$compose_cmd stop | ||
;; | ||
*) | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
main "$@" |
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,29 @@ | ||
version: "3.9" | ||
|
||
services: | ||
# Essentially wi-dev, but doesn't expose port 9200 | ||
wi-build: | ||
image: wi-build:${VERSION} | ||
container_name: wi-build_${VERSION} | ||
build: | ||
context: ./../.. | ||
dockerfile: ${REPO_PATH}/docker/dev/images/Dockerfile | ||
volumes: | ||
- ${REPO_PATH}:/home/wazuh-indexer | ||
entrypoint: ["tail", "-f", "/dev/null"] | ||
user: "1000:1000" | ||
working_dir: /home/wazuh-indexer | ||
|
||
wi-assemble: | ||
image: wi-assemble:${VERSION} | ||
container_name: wi-assemble_${VERSION} | ||
build: | ||
context: ./../.. | ||
dockerfile: ${REPO_PATH}/docker/ci/images/Dockerfile | ||
volumes: | ||
- ${REPO_PATH}/scripts:/home/wazuh-indexer/scripts | ||
- ${REPO_PATH}/artifacts:/home/wazuh-indexer/artifacts | ||
- ${REPO_PATH}/distribution/packages/src:/home/wazuh-indexer/distribution/packages/src | ||
entrypoint: ["tail", "-f", "/dev/null"] | ||
user: "1000:1000" | ||
working_dir: /home/wazuh-indexer |
File renamed without changes.
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,17 @@ | ||
FROM ubuntu:jammy | ||
RUN mkdir /home/wazuh-indexer && \ | ||
apt-get update -y && \ | ||
apt-get install curl gnupg2 -y && \ | ||
curl -o- https://www.aptly.info/pubkey.txt | apt-key add - && \ | ||
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 clean -y && \ | ||
dpkg -r lintian && \ | ||
addgroup --gid 1000 wazuh-indexer && \ | ||
adduser --uid 1000 --ingroup wazuh-indexer --disabled-password --home /home/wazuh-indexer wazuh-indexer && \ | ||
chmod 0775 /home/wazuh-indexer && \ | ||
chown -R 1000:1000 /home/wazuh-indexer | ||
USER wazuh-indexer | ||
WORKDIR /home/wazuh-indexer |
This file was deleted.
Oops, something went wrong.
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
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,19 @@ | ||
version: "3.9" | ||
|
||
services: | ||
wi-dev: | ||
image: wi-dev:${VERSION} | ||
container_name: wi-dev_${VERSION} | ||
build: | ||
context: ./../.. | ||
dockerfile: ${REPO_PATH}/docker/dev/images/Dockerfile | ||
ports: | ||
# OpenSearch REST API | ||
- 9200:9200 | ||
expose: | ||
- 9200 | ||
volumes: | ||
- ${REPO_PATH}:/home/wazuh-indexer | ||
entrypoint: ["tail", "-f", "/dev/null"] | ||
user: "1000:1000" | ||
working_dir: /home/wazuh-indexer |
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 @@ | ||
artifacts/ | ||
.git/ | ||
|
||
# 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
Oops, something went wrong.