diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56d816394385a..9de072580f159 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,6 +245,8 @@ jobs: -a ${{ matrix.architecture }} \ -d ${{ matrix.distribution }} \ -r ${{ inputs.revision }} \ + -l ${{ needs.build-wazuh-plugins.outputs.hash }} \ + -e ${{ needs.build-reporting-plugin.outputs.hash }} \ ${{ inputs.is_stage && '-x' || '' }} \ ) echo "name=$name" >> $GITHUB_OUTPUT @@ -253,12 +255,12 @@ jobs: - name: Run `baptizer.sh` # As parameters run: | - PLUGINS_HASH=${{ needs.build-wazuh-plugins.outputs.hash }} \ - REPORTING_HASH=${{ needs.build-reporting-plugin.outputs.hash }} \ name=$(bash build-scripts/baptizer.sh \ -a ${{ matrix.architecture }} \ -d ${{ matrix.distribution }} \ -r ${{ inputs.revision }} \ + -l ${{ needs.build-wazuh-plugins.outputs.hash }} \ + -e ${{ needs.build-reporting-plugin.outputs.hash }} \ ${{ inputs.is_stage && '-x' || '' }} \ ) echo "name=$name" >> $GITHUB_OUTPUT diff --git a/build-scripts/baptizer.sh b/build-scripts/baptizer.sh index d892231ae51fa..537fae43491d5 100644 --- a/build-scripts/baptizer.sh +++ b/build-scripts/baptizer.sh @@ -10,6 +10,8 @@ function usage() { echo -e "-a ARCHITECTURE\t[Optional] Build architecture, default is 'uname -m'." echo -e "-d DISTRIBUTION\t[Optional] Distribution, default is 'tar'." echo -e "-r REVISION\t[Optional] Package revision, default is '0'." + echo -e "-l PLUGINS_HASH\t[Optional] Commit hash from the wazuh-indexer-plugins repository" + echo -e "-e REPORTING_HASH\t[Optional] Commit hash from the wazuh-indexer-reporting repository" echo -e "-m MIN\t[Optional] Use naming convention for minimal packages, default is 'false'." echo -e "-x RELEASE\t[Optional] Use release naming convention, default is 'false'." echo -e "-h help" @@ -20,7 +22,7 @@ function usage() { # ==== function parse_args() { - while getopts ":h:p:a:d:r:mx" arg; do + while getopts ":h:p:a:d:r:l:e:mx" arg; do case $arg in h) usage @@ -38,6 +40,12 @@ function parse_args() { r) REVISION=$OPTARG ;; + l) + PLUGINS_HASH=$OPTARG + ;; + e) + REPORTING_HASH=$OPTARG + ;; m) IS_MIN=true ;; @@ -129,7 +137,7 @@ function get_devel_name() { PREFIX="$PREFIX"-min fi # Generate composed commit hash - if "$PLUGINS_HASH" && "$REPORTING_HASH"; then + if [ -n "$PLUGINS_HASH" ] && [ -n "$REPORTING_HASH" ]; then COMMIT_HASH="$GIT_COMMIT"-"$PLUGINS_HASH"-"$REPORTING_HASH" fi PACKAGE_NAME="$PREFIX"_"$VERSION"-"$REVISION"_"$SUFFIX"_"$COMMIT_HASH"."$EXT"