Add support for multible registrys (#23)
if normal settings `registry`, `username`... is set
that's used as default, else first logins entry is used.
```yml
settings:
logins:
- registry: https://codeberg.org
username: "6543"
password: geheim
- registry: https://index.docker.io/v1/
username: a6543
password: anders_geheim
```
close #18
Reviewed-on: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/pulls/23
Reviewed-by: anbraten <anbraten@noreply.codeberg.org>
This commit is contained in:
@@ -200,31 +200,38 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
||||
EnvVars: []string{"PLUGIN_REGISTRY", "DOCKER_REGISTRY"},
|
||||
Usage: "sets docker registry to authenticate with",
|
||||
Value: "https://index.docker.io/v1/",
|
||||
Destination: &settings.Login.Registry,
|
||||
Destination: &settings.DefaultLogin.Registry,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "docker.username",
|
||||
EnvVars: []string{"PLUGIN_USERNAME", "DOCKER_USERNAME"},
|
||||
Usage: "sets username to authenticates with",
|
||||
Destination: &settings.Login.Username,
|
||||
Destination: &settings.DefaultLogin.Username,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "docker.password",
|
||||
EnvVars: []string{"PLUGIN_PASSWORD", "DOCKER_PASSWORD"},
|
||||
Usage: "sets password to authenticates with",
|
||||
Destination: &settings.Login.Password,
|
||||
Destination: &settings.DefaultLogin.Password,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "docker.email",
|
||||
EnvVars: []string{"PLUGIN_EMAIL", "DOCKER_EMAIL"},
|
||||
Usage: "sets email address to authenticates with",
|
||||
Destination: &settings.Login.Email,
|
||||
Destination: &settings.DefaultLogin.Email,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "docker.config",
|
||||
EnvVars: []string{"PLUGIN_CONFIG", "DOCKER_PLUGIN_CONFIG"},
|
||||
Usage: "sets content of the docker daemon json config",
|
||||
Destination: &settings.Login.Config,
|
||||
Destination: &settings.DefaultLogin.Config,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "logins",
|
||||
EnvVars: []string{"PLUGIN_LOGINS"},
|
||||
Usage: "list of login",
|
||||
Destination: &settings.LoginsRaw,
|
||||
Value: "[]",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "docker.purge",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build tools
|
||||
// +build tools
|
||||
|
||||
package tools
|
||||
|
||||
Reference in New Issue
Block a user