sensu / monitoring-plugins

Sensu Assets for the monitoring-plugins.org project
https://monitoring-plugins.org
5 stars 17 forks source link

Refactor/ci testing #38

Open jspaleta opened 2 years ago

jspaleta commented 2 years ago

This refactors the build process and introduces a CI test framework.

Summary

  1. Reduce the number of images built and instead rely on cross linux distribution testing matrix to test which builds are appropriate for which linux distribution targets.
  2. Introduce test framework to add tests for each included plugin.
  3. Validate that asset tarballs referenced in .bonsai.yml exist as builds in the assets directory prior to uploading into github releases.
  4. Introduce test github action to build and validate on every push, in order to catch problems introduced by drift in target linux distribution docker images.

Notes:

scripts/build_and_validate.sh

This script is the driver behind the refactor. Makes uses of a builds/ where the details for the reference builds can customized, including which plugins are to be tested and which linux distributions are to be tested for each build.

For example the alpine asset built is only tested against alpine, because it cannot be used with traditional linux distributions.

But the debian8 asset built is tested against all supported debian, ubuntu and centos targets (except centos6).

.bonsai.yml

The debian8 asset tarball is now the preferred build for all new linux targets that will be defined in the .bonsai.yml. The first step in adding any new linux target in the .bonsai.yml is to first test the debian8 build against that linux target's docker image. If debian8 build passes all the tests it can be used in the new .bonsai.yml definition with appropriate filters.

If debian8 tarball can't be testd to work, a new build platform can be added. Ex: centos6 build is provided explicitly because debian8 build will not work on centos6.

elfranne commented 2 years ago

Debian 8 (and 9) are EOL. Is there a reason to use Debian 8 ?