From a6e9c215ec3d63f224832785568b88effde7407b Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 12 May 2016 22:14:33 -0700 Subject: [PATCH] bump version number, auto-pull new plugins, process http_proxy vars --- drone/agent/agent.go | 4 ++-- version/version.go | 4 ++-- yaml/transform/environ.go | 25 ++++++++++++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/drone/agent/agent.go b/drone/agent/agent.go index 5481ea358..c729c4e60 100644 --- a/drone/agent/agent.go +++ b/drone/agent/agent.go @@ -117,7 +117,7 @@ var AgentCmd = cli.Command{ Value: "plugins", Usage: "default plugin image namespace", }, - cli.BoolFlag{ + cli.BoolTFlag{ EnvVar: "DRONE_PLUGIN_PULL", Name: "pull", Usage: "always pull latest plugin images", @@ -172,7 +172,7 @@ func start(c *cli.Context) { timeout: c.Duration("timeout"), namespace: c.String("namespace"), privileged: c.StringSlice("privileged"), - pull: c.Bool("pull"), + pull: c.BoolT("pull"), logs: int64(c.Int("max-log-size")) * 1000000, }, } diff --git a/version/version.go b/version/version.go index e63f3e022..170e25b92 100644 --- a/version/version.go +++ b/version/version.go @@ -6,9 +6,9 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor = 0 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 4 + VersionMinor = 5 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 1 + VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. VersionDev = "dev" diff --git a/yaml/transform/environ.go b/yaml/transform/environ.go index 47e1e6e4d..b00c051ba 100644 --- a/yaml/transform/environ.go +++ b/yaml/transform/environ.go @@ -1,6 +1,17 @@ package transform -import "github.com/drone/drone/yaml" +import ( + "os" + "strings" + + "github.com/drone/drone/yaml" +) + +var ( + httpProxy = os.Getenv("HTTP_PROXY") + httpsProxy = os.Getenv("HTTPS_PROXY") + noProxy = os.Getenv("NO_PROXY") +) // Environ transforms the steps in the Yaml pipeline to include runtime // environment variables. @@ -15,6 +26,18 @@ func Environ(c *yaml.Config, envs map[string]string) error { } p.Environment[k] = v } + if httpProxy != "" { + p.Environment["HTTP_PROXY"] = httpProxy + p.Environment["http_proxy"] = strings.ToUpper(httpProxy) + } + if httpsProxy != "" { + p.Environment["HTTPS_PROXY"] = httpsProxy + p.Environment["https_proxy"] = strings.ToUpper(httpsProxy) + } + if noProxy != "" { + p.Environment["NO_PROXY"] = noProxy + p.Environment["no_proxy"] = strings.ToUpper(noProxy) + } } return nil }