forked from Ivasoft/drone-docker
Add option to mount host ssh agent (--ssh)
This commit is contained in:
@@ -274,6 +274,11 @@ func main() {
|
||||
Usage: "platform value to pass to docker",
|
||||
EnvVar: "PLUGIN_PLATFORM",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "ssh-agent",
|
||||
Usage: "mount ssh agent",
|
||||
EnvVar: "PLUGIN_SSH_AGENT",
|
||||
},
|
||||
}
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
@@ -318,6 +323,7 @@ func run(c *cli.Context) error {
|
||||
AddHost: c.StringSlice("add-host"),
|
||||
Quiet: c.Bool("quiet"),
|
||||
Platform: c.String("platform"),
|
||||
SSHAgent: c.StringSlice("ssh-agent"),
|
||||
},
|
||||
Daemon: docker.Daemon{
|
||||
Registry: c.String("docker.registry"),
|
||||
|
||||
@@ -64,6 +64,7 @@ type (
|
||||
AddHost []string // Docker build add-host
|
||||
Quiet bool // Docker build quiet
|
||||
Platform string // Docker build platform
|
||||
SSHAgent []string // Docker build ssh
|
||||
}
|
||||
|
||||
// Plugin defines the Docker plugin parameters.
|
||||
@@ -328,6 +329,9 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
if build.Platform != "" {
|
||||
args = append(args, "--platform", build.Platform)
|
||||
}
|
||||
if build.SSHAgent != "" {
|
||||
args = append(args, "--ssh", build.SSHAgent)
|
||||
}
|
||||
|
||||
if build.AutoLabel {
|
||||
labelSchema := []string{
|
||||
|
||||
Reference in New Issue
Block a user