mirror of
https://github.com/drone/drone-cli.git
synced 2024-11-23 01:11:57 +01:00
allow registry credentials in drone exec
This commit is contained in:
parent
b2aebbf41b
commit
ada4e9de7e
@ -79,6 +79,10 @@ var Command = cli.Command{
|
||||
Name: "network",
|
||||
Usage: "external networks",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "registry",
|
||||
Usage: "registry",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "secret-file",
|
||||
Usage: "secret file",
|
||||
@ -321,11 +325,11 @@ func toRegistry(items []string) []*engine.DockerAuth {
|
||||
if err != nil {
|
||||
continue // skip invalid
|
||||
}
|
||||
host := uri.Host
|
||||
user := uri.User.Username()
|
||||
pass, _ := uri.User.Password()
|
||||
uri.User = nil
|
||||
auths = append(auths, &engine.DockerAuth{
|
||||
Address: host,
|
||||
Address: uri.String(),
|
||||
Username: user,
|
||||
Password: pass,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user