Merge pull request #1641 from bradrydzewski/master

bump version number, auto-pull new plugins, process http_proxy vars
This commit is contained in:
Brad Rydzewski 2016-05-12 22:40:52 -07:00
commit a607f881ab
3 changed files with 28 additions and 5 deletions

View file

@ -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,
},
}

View file

@ -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"

View file

@ -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
}