From 0f0aba7f820aeb1421f5791700444cf4406ba4ad Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Sun, 8 Oct 2023 08:49:51 +0000 Subject: [PATCH] Allow to load env file (#80) closes https://codeberg.org/woodpecker-plugins/docker-buildx/issues/34 Reviewed-on: https://codeberg.org/woodpecker-plugins/docker-buildx/pulls/80 Reviewed-by: anbraten Co-authored-by: qwerty287 Co-committed-by: qwerty287 --- cmd/docker-buildx/main.go | 4 ++++ docs.md | 1 + 2 files changed, 5 insertions(+) diff --git a/cmd/docker-buildx/main.go b/cmd/docker-buildx/main.go index c936baa..5531f44 100644 --- a/cmd/docker-buildx/main.go +++ b/cmd/docker-buildx/main.go @@ -19,6 +19,10 @@ func main() { if _, err := os.Stat("/run/drone/env"); err == nil { godotenv.Overload("/run/drone/env") } + + if envFile, set := os.LookupEnv("PLUGIN_ENV_FILE"); set { + godotenv.Overload(envFile) + } app := &cli.App{ Name: "docker-buildx", diff --git a/docs.md b/docs.md index cc620c6..3275862 100644 --- a/docs.md +++ b/docs.md @@ -122,6 +122,7 @@ If it's not a tag event, and no default branch, automated tags are skipped. | `add_host` | *none* | sets additional host:ip mapping | `output` | *none* | sets build output in format `type=[,=]` | `logins` | *none* | option to log into multiple registries +| `env_file` | *none* | load env vars from specified file ## Multi registry push example