option to disable netrc for non-clone steps
This commit is contained in:
@@ -92,6 +92,10 @@ type Config struct {
|
||||
SkipVerify bool `envconfig:"DRONE_SECRET_PLUGIN_SKIP_VERIFY"`
|
||||
}
|
||||
|
||||
Netrc struct {
|
||||
CloneOnly bool `envconfig:"DRONE_NETRC_CLONE_ONLY"`
|
||||
}
|
||||
|
||||
Registry struct {
|
||||
Endpoint string `envconfig:"DRONE_REGISTRY_PLUGIN_ENDPOINT"`
|
||||
Token string `envconfig:"DRONE_REGISTRY_PLUGIN_TOKEN"`
|
||||
|
||||
@@ -93,6 +93,11 @@ func (c *daemonCommand) run(*kingpin.ParseContext) error {
|
||||
if err == context.Canceled {
|
||||
break
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
default:
|
||||
}
|
||||
if err != nil {
|
||||
logrus.WithError(err).
|
||||
Errorln("cannot ping the docker daemon")
|
||||
@@ -111,6 +116,7 @@ func (c *daemonCommand) run(*kingpin.ParseContext) error {
|
||||
runner := &runtime.Runner{
|
||||
Client: cli,
|
||||
Machine: config.Runner.Name,
|
||||
Environ: config.Runner.Environ,
|
||||
Reporter: tracer,
|
||||
Lookup: resource.Lookup,
|
||||
Lint: linter.New().Lint,
|
||||
@@ -120,11 +126,12 @@ func (c *daemonCommand) run(*kingpin.ParseContext) error {
|
||||
config.Limit.Trusted,
|
||||
),
|
||||
Compiler: &compiler.Compiler{
|
||||
Clone: config.Runner.Clone,
|
||||
Privileged: append(config.Runner.Privileged, compiler.Privileged...),
|
||||
Networks: config.Runner.Networks,
|
||||
NetworkOpts: config.Runner.NetworkOpts,
|
||||
Volumes: config.Runner.Volumes,
|
||||
Clone: config.Runner.Clone,
|
||||
Privileged: append(config.Runner.Privileged, compiler.Privileged...),
|
||||
Networks: config.Runner.Networks,
|
||||
NetworkOpts: config.Runner.NetworkOpts,
|
||||
NetrcCloneOnly: config.Netrc.CloneOnly,
|
||||
Volumes: config.Runner.Volumes,
|
||||
Resources: compiler.Resources{
|
||||
Memory: config.Resources.Memory,
|
||||
MemorySwap: config.Resources.MemorySwap,
|
||||
|
||||
@@ -66,15 +66,17 @@ func (c *processCommand) run(*kingpin.ParseContext) error {
|
||||
runner := &runtime.Runner{
|
||||
Client: cli,
|
||||
Machine: config.Runner.Name,
|
||||
Environ: config.Runner.Environ,
|
||||
Reporter: remote,
|
||||
Lookup: resource.Lookup,
|
||||
Lint: linter.New().Lint,
|
||||
Match: nil,
|
||||
Compiler: &compiler.Compiler{
|
||||
Clone: config.Runner.Clone,
|
||||
Privileged: append(config.Runner.Privileged, compiler.Privileged...),
|
||||
Networks: config.Runner.Networks,
|
||||
Volumes: config.Runner.Volumes,
|
||||
Clone: config.Runner.Clone,
|
||||
Privileged: append(config.Runner.Privileged, compiler.Privileged...),
|
||||
Networks: config.Runner.Networks,
|
||||
NetrcCloneOnly: config.Netrc.CloneOnly,
|
||||
Volumes: config.Runner.Volumes,
|
||||
Resources: compiler.Resources{
|
||||
Memory: config.Resources.Memory,
|
||||
MemorySwap: config.Resources.MemorySwap,
|
||||
|
||||
Reference in New Issue
Block a user