wazuh / wazuh-indexer

Wazuh indexer, the Wazuh search engine
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
6 stars 16 forks source link

[CI] Packaging scripts redesign #180

Closed AlexRuiz7 closed 3 months ago

AlexRuiz7 commented 4 months ago

Description

During the works of #155, I've noticed that the scripts used to manage the generation of packages are very tightly coupled, making it difficult to extend the CI pipeline implemented in GH Actions.

The main cause is the fragile method we currently use to share the name of the package from step to step in the workflow.

The package is the main and only resource that the workflow handles, so it would be much easier if it were accessible globally, being calculated beforehand as the first step of the pipeline.

We already calculate some values as initial setup, such as the Git commit and the version number of the project. These values are used to dynamically generate the name of the packages, as follows:

wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}

The plan is to use a script to generate the name of the packages.

We'll also need to get rid of the OPENSEARCH_VERSION environment variable used in GH Actions to build and assemble packages. Instead, the packaging scripts should be able to detect the OpenSearch version for which the packages are being built, in other words, the version of OpenSearch that wazuh-indexer is based on. It can be obtained with the following command:

cat buildSrc/version.properties | grep opensearch | grep -Eo '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}'

Tasks

AlexRuiz7 commented 3 months ago

Working on https://github.com/wazuh/wazuh-indexer/issues/188#issuecomment-2020155883