Installing dependencies
If your collector or cataloger requires dependencies, you can install them by adding an install.sh script to the same directory as your lunar-config.yml or lunar-cataloger.yml file.
This install script is executed only once in each environment, before the collector or cataloger is run.
Example
#!/usr/bin/env bash
curl -L "https://github.com/keilerkonzept/dockerfile-json/releases/download/v1.2.2/dockerfile-json_Linux_x86_64.tar.gz" | tar xz
mv dockerfile-json "$LUNAR_BIN_DIR/"Installation path
If you need to install a binary that will be used in the collector or cataloger, you can use the LUNAR_BIN_DIR environment variable. This will ensure the binary is available in the PATH.
Multi-platform support
For platform-specific logic, you can use install-<os>-<arch>.sh or install-<os>.sh files. Making your script multi-platform is useful to allow for local development of catalogers and collectors, when your local platform may differ from the one Lunar's runners, or your CI is running on.
Platform-specific scripts are checked for existence in the following order:
- install-<os>-<arch>.sh
- install-<os>.sh
- install.sh
Only the first script found is executed.
Examples of valid platform-specific script names are:
- install-linux-amd64.sh
- install-linux-arm64.sh
- install-linux.sh
- install-darwin-arm64.sh
- install-darwin.sh
Last updated