Add option to source env from file
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/dockerhub Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test/1 Pipeline was successful
ci/woodpecker/push/test/2 Pipeline was successful

This commit is contained in:
Stephan Schnabel 2025-06-24 21:12:16 +02:00
parent 8aa00208d3
commit 9769ea1ba4
Signed by: stephan.schnabel
SSH key fingerprint: SHA256:99zuzxNGFb5/5P+E/O7ONU2qhUojUe/D8rIPTW+9Xp0
2 changed files with 10 additions and 0 deletions

View file

@ -5,6 +5,15 @@ set -eu;
## check input
##
if [[ -n "${PLUGIN_ENV_FILE:-}" ]]; then
if [[ ! -f "PLUGIN_ENV_FILE" ]]; then
echo "Env file $PLUGIN_ENV_FILE not found."
exit 1
fi
# shellcheck source=/dev/null
source "$PLUGIN_ENV_FILE"
fi
BUILDCTL_CONTEXT=${PLUGIN_CONTEXT:-$(pwd)}
BUILDCTL_DOCKERFILE=$(dirname "${PLUGIN_DOCKERFILE:-$BUILDCTL_CONTEXT/Dockerfile}")
if [[ ! -f $BUILDCTL_DOCKERFILE/Dockerfile ]]; then