Add support for multiple Buildkit secrets with env vars or files as source (#359)

This commit is contained in:
Stefano Arlandini
2022-05-03 11:22:55 +02:00
committed by GitHub
parent d0b9da388f
commit 94f2f970db
3 changed files with 182 additions and 1 deletions

View File

@@ -254,6 +254,16 @@ func main() {
Usage: "secret key value pair eg id=MYSECRET",
EnvVar: "PLUGIN_SECRET",
},
cli.StringSliceFlag{
Name: "secrets-from-env",
Usage: "secret key value pair eg secret_name=secret",
EnvVar: "PLUGIN_SECRETS_FROM_ENV",
},
cli.StringSliceFlag{
Name: "secrets-from-file",
Usage: "secret key value pairs eg secret_name=/path/to/secret",
EnvVar: "PLUGIN_SECRETS_FROM_FILE",
},
cli.StringFlag{
Name: "drone-card-path",
Usage: "card path location to write to",
@@ -298,6 +308,8 @@ func run(c *cli.Context) error {
Link: c.String("link"),
NoCache: c.Bool("no-cache"),
Secret: c.String("secret"),
SecretEnvs: c.StringSlice("secrets-from-env"),
SecretFiles: c.StringSlice("secrets-from-file"),
AddHost: c.StringSlice("add-host"),
Quiet: c.Bool("quiet"),
},