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:
@@ -10,19 +10,6 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// helper function to create the docker login command.
|
||||
func commandLogin(login Login) *exec.Cmd {
|
||||
if login.Email != "" {
|
||||
return commandLoginEmail(login)
|
||||
}
|
||||
return exec.Command(
|
||||
dockerExe, "login",
|
||||
"-u", login.Username,
|
||||
"-p", login.Password,
|
||||
login.Registry,
|
||||
)
|
||||
}
|
||||
|
||||
// helper to check if args match "docker pull <image>"
|
||||
func isCommandPull(args []string) bool {
|
||||
return len(args) > 2 && args[1] == "pull"
|
||||
|
||||
Reference in New Issue
Block a user