Skip to content

Commit

Permalink
chore(ci/cd): improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Jan 25, 2025
1 parent 5bcb68f commit 51b3c9e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
10 changes: 7 additions & 3 deletions build/debian11/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3 --version
python3 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# prepare files for fpm
prepare_fpm "$PACKAGE_VERSION" "$PACKAGE_ITERATION" "$MONITORING_PLUGINS_DIR"
Expand Down
10 changes: 7 additions & 3 deletions build/debian12/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3 --version
python3 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# prepare files for fpm
prepare_fpm "$PACKAGE_VERSION" "$PACKAGE_ITERATION" "$MONITORING_PLUGINS_DIR"
Expand Down
10 changes: 7 additions & 3 deletions build/rocky8/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3 --version
python3 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# RHEL only - compile .te file to .pp for SELinux
mkdir /tmp/selinux
Expand Down
10 changes: 7 additions & 3 deletions build/ubuntu2004/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3.9 --version
python3.9 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# prepare files for fpm
prepare_fpm "$PACKAGE_VERSION" "$PACKAGE_ITERATION" "$MONITORING_PLUGINS_DIR"
Expand Down
10 changes: 7 additions & 3 deletions build/ubuntu2204/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3 --version
python3 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# prepare files for fpm
prepare_fpm "$PACKAGE_VERSION" "$PACKAGE_ITERATION" "$MONITORING_PLUGINS_DIR"
Expand Down
10 changes: 7 additions & 3 deletions build/ubuntu2404/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

PACKAGE_VERSION="$1"
PACKAGE_ITERATION="$2"

if [[ -z "$PACKAGE_VERSION" || -z "$PACKAGE_ITERATION" ]]; then
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION>"
echo "Usage: $(basename "$0") <PACKAGE_VERSION> <PACKAGE_ITERATION> [<CHECK_PLUGIN>]"
echo " PACKAGE_VERSION: Version number starting with a digit (e.g. 2023123101) or 'main' for the latest development version."
echo " PACKAGE_ITERATION: Iteration number (e.g. 2) to specify the bugfix level for this package."
echo " CHECK_PLUGIN: Optional. If you only want to compile a specific check plugin, specify its name, for example 'xml'."
exit 1
fi
CHECK_PLUGIN="$3"
if [[ -z "$CHECK_PLUGIN" ]]; then
CHECK_PLUGIN='*'
fi

CURRENT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")"
BUILD_SHARED_DIR="$CURRENT_DIR/../shared"
Expand All @@ -30,7 +34,7 @@ source /opt/venv/bin/activate
python3 --version
python3 -m pip install --requirement="$MONITORING_PLUGINS_DIR/requirements.txt" --require-hashes

compile_plugins "$MONITORING_PLUGINS_DIR"
compile_plugins "$MONITORING_PLUGINS_DIR" "$CHECK_PLUGIN"

# prepare files for fpm
prepare_fpm "$PACKAGE_VERSION" "$PACKAGE_ITERATION" "$MONITORING_PLUGINS_DIR"
Expand Down

0 comments on commit 51b3c9e

Please sign in to comment.