support for new env plugin

This commit is contained in:
Brad Rydzewski
2019-11-20 10:01:42 -08:00
parent 6c9e3ac5c0
commit 8fa2a23129
10 changed files with 47 additions and 10 deletions

View File

@@ -78,6 +78,12 @@ type Config struct {
CPUSet []string `envconfig:"DRONE_CPU_SET"`
}
Environ struct {
Endpoint string `envconfig:"DRONE_ENV_PLUGIN_ENDPOINT"`
Token string `envconfig:"DRONE_ENV_PLUGIN_TOKEN"`
SkipVerify bool `envconfig:"DRONE_ENV_PLUGIN_SKIP_VERIFY"`
}
Secret struct {
Endpoint string `envconfig:"DRONE_SECRET_PLUGIN_ENDPOINT"`
Token string `envconfig:"DRONE_SECRET_PLUGIN_TOKEN"`

View File

@@ -16,6 +16,7 @@ import (
"github.com/drone-runners/drone-runner-docker/runtime"
"github.com/drone/runner-go/client"
"github.com/drone/runner-go/environ/provider"
"github.com/drone/runner-go/handler/router"
"github.com/drone/runner-go/logger"
loghistory "github.com/drone/runner-go/logger/history"
@@ -120,7 +121,6 @@ func (c *daemonCommand) run(*kingpin.ParseContext) error {
),
Compiler: &compiler.Compiler{
Clone: config.Runner.Clone,
Environ: config.Runner.Environ,
Privileged: append(config.Runner.Privileged, compiler.Privileged...),
Networks: config.Runner.Networks,
Volumes: config.Runner.Volumes,
@@ -132,6 +132,14 @@ func (c *daemonCommand) run(*kingpin.ParseContext) error {
CPUShares: config.Resources.CPUShares,
CPUSet: config.Resources.CPUSet,
},
Environ: provider.Combine(
provider.Static(config.Runner.Environ),
provider.External(
config.Environ.Endpoint,
config.Environ.Token,
config.Environ.SkipVerify,
),
),
Registry: registry.Combine(
registry.File(
config.Docker.Config,