Shared helpers to dry out common CI scripts used by plugins.
LogStash plugins by convention store configuration under ci/ folder,
.ci is meant to be an optional replacement for most ci/* files.
There's also assumptions about using rspec to write tests currently.
Set up your plugin's .travis.yml:
import:
- logstash-plugins/.ci:travis/[email protected]
- logstash-plugins/.ci:travis/[email protected]
- logstash-plugins/.ci:travis/[email protected]
If the plugin follows conventions and (unit) tests all run using rspec, simply
place your own shell scripts in the .ci folder
In some circumstances on MacOS, Rosetta2 could kicks it and generate an error related to QEMU not able to run some x86 code, for example:
ci-logstash-1 | Failed (Expected: 10000 got: 0, execution output:
ci-logstash-1 | qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
ci-logstash-1 | ). Sleeping for 2.0
In such cases set and export DOCKER_DEFAULT_PLATFORM environment variable:
export DOCKER_DEFAULT_PLATFORM=linux/amd64
and then rebuild the image:
.ci/docker-setup.sh && .ci/docker-run.sh
Run path/to/this/repo/add-scripts-to-current-plugin.sh from within your plugin root to
unpack the published scripts into your plugin in the same way CI would.
Then, you can run docker-setup.sh and docker-run.sh to actually run the tests. You likely
will want to set environment variables from the plugin's travis.yml before running docker-run.sh.
yqmust be installed (used to readtravis/exec.yml). For macOS with Homebrew:brew install yqcurlandtaravailable in your shell.