diff --git a/server/hook.go b/server/hook.go index 15f03c55c9..5e8d35d361 100644 --- a/server/hook.go +++ b/server/hook.go @@ -464,7 +464,14 @@ func (b *builder) Build() ([]*buildItem, error) { // TODO ability to customize the escalated plugins compiler.WithEscalated("plugins/docker", "plugins/gcr", "plugins/ecr"), compiler.WithLocal(false), - compiler.WithNetrc(b.Netrc.Login, b.Netrc.Password, b.Netrc.Machine), + compiler.WithOption( + compiler.WithNetrc( + b.Netrc.Login, + b.Netrc.Password, + b.Netrc.Machine, + ), + b.Repo.IsPrivate, + ), compiler.WithPrefix( fmt.Sprintf( "%d_%d", diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go index 8f70710601..02c3985988 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go @@ -28,9 +28,11 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen }, } - volumes := []string{ - workspace, + var volumes []string + if !c.local { + volumes = append(volumes, workspace) } + volumes = append(volumes, c.volumes...) for _, volume := range container.Volumes.Volumes { volumes = append(volumes, volume.String()) } diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go index 1ee66a002b..34fef466b4 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go @@ -12,6 +12,17 @@ import ( // Option configures a compiler option. type Option func(*Compiler) +// WithOption configures the compiler with the given option if +// boolean b evaluates to true. +func WithOption(option Option, b bool) Option { + switch { + case b: + return option + default: + return func(compiler *Compiler) {} + } +} + // WithVolumes configutes the compiler with default volumes that // are mounted to each container in the pipeline. func WithVolumes(volumes ...string) Option { diff --git a/vendor/vendor.json b/vendor/vendor.json index f349dbf26c..a741a8fb89 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -28,68 +28,68 @@ { "checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=", "path": "github.com/cncd/pipeline/pipeline", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "Qu2FreqaMr8Yx2bW9O0cxAGgjr0=", "path": "github.com/cncd/pipeline/pipeline/backend", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "0CGXRaYwZhJxGIrGhn8WGpkFqPo=", "path": "github.com/cncd/pipeline/pipeline/backend/docker", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "/8wE+cVb7T4PQZgpLNu0DHzKGuE=", "path": "github.com/cncd/pipeline/pipeline/frontend", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "O0sulBQAHJeNLg3lO38Cq5uf/eg=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { - "checksumSHA1": "srNvtlujHSHC8YXrnFPdy5V7qoQ=", + "checksumSHA1": "ftyr9EJQl9D5OvzOcqGBS6stt0g=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "Q0GkNUFamVYIA1Fd8r0A5M6Gx54=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=", "path": "github.com/cncd/pipeline/pipeline/multipart", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "MratmNKJ78/IhWvDsZphN01CtmE=", "path": "github.com/cncd/pipeline/pipeline/rpc", - "revision": "3614f41e777232289a3cd479c2301274556e3346", - "revisionTime": "2017-03-14T15:17:46Z" + "revision": "addc99dad68008570994f8de318101adfe4161a6", + "revisionTime": "2017-03-19T09:04:25Z" }, { "checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=",