read registry credentials [CI SKIP]

This commit is contained in:
Brad Rydzewski
2019-10-17 16:05:49 -07:00
parent 983f1badde
commit f0bea94a58
3 changed files with 44 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/drone/envsubst"
"github.com/drone/runner-go/environ"
"github.com/drone/runner-go/manifest"
"github.com/drone/runner-go/registry"
"github.com/drone/runner-go/secret"
"gopkg.in/alecthomas/kingpin.v2"
@@ -34,6 +35,7 @@ type compileCommand struct {
Labels map[string]string
Secrets map[string]string
Resources compiler.Resources
Config string
}
func (c *compileCommand) run(*kingpin.ParseContext) error {
@@ -108,6 +110,9 @@ func (c *compileCommand) run(*kingpin.ParseContext) error {
Networks: c.Networks,
Volumes: c.Volumes,
Secret: secret.StaticVars(c.Secrets),
Registry: registry.Combine(
registry.File(c.Config),
),
}
spec := comp.Compile(nocontext)
@@ -172,6 +177,9 @@ func registerCompile(app *kingpin.Application) {
cmd.Flag("shmsize", "container shm size").
Int64Var(&c.Resources.ShmSize)
cmd.Flag("docker-config", "path to the docker config file").
StringVar(&c.Config)
// shared pipeline flags
c.Flags = internal.ParseFlags(cmd)
}