mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-04 16:09:33 +00:00
Merge pull request #1994 from bradrydzewski/master
support docker-compose secret declaration
This commit is contained in:
commit
15e2195733
14 changed files with 212 additions and 160 deletions
|
@ -115,9 +115,6 @@ type Client interface {
|
||||||
// target environment.
|
// target environment.
|
||||||
Deploy(string, string, int, string, map[string]string) (*model.Build, error)
|
Deploy(string, string, int, string, map[string]string) (*model.Build, error)
|
||||||
|
|
||||||
// AgentList returns a list of build agents.
|
|
||||||
AgentList() ([]*model.Agent, error)
|
|
||||||
|
|
||||||
// Registry returns a registry by hostname.
|
// Registry returns a registry by hostname.
|
||||||
Registry(owner, name, hostname string) (*model.Registry, error)
|
Registry(owner, name, hostname string) (*model.Registry, error)
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ const (
|
||||||
pathUsers = "%s/api/users"
|
pathUsers = "%s/api/users"
|
||||||
pathUser = "%s/api/users/%s"
|
pathUser = "%s/api/users/%s"
|
||||||
pathBuildQueue = "%s/api/builds"
|
pathBuildQueue = "%s/api/builds"
|
||||||
pathAgent = "%s/api/agents"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type client struct {
|
type client struct {
|
||||||
|
@ -367,14 +366,6 @@ func (c *client) Sign(owner, name string, in []byte) ([]byte, error) {
|
||||||
return ioutil.ReadAll(rc)
|
return ioutil.ReadAll(rc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AgentList returns a list of build agents.
|
|
||||||
func (c *client) AgentList() ([]*model.Agent, error) {
|
|
||||||
var out []*model.Agent
|
|
||||||
uri := fmt.Sprintf(pathAgent, c.base)
|
|
||||||
err := c.get(uri, &out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Registry returns a registry by hostname.
|
// Registry returns a registry by hostname.
|
||||||
func (c *client) Registry(owner, name, hostname string) (*model.Registry, error) {
|
func (c *client) Registry(owner, name, hostname string) (*model.Registry, error) {
|
||||||
out := new(model.Registry)
|
out := new(model.Registry)
|
||||||
|
|
|
@ -120,8 +120,11 @@ func secretDisplayList(secrets []*model.Secret, c *cli.Context) error {
|
||||||
// template for secret list items
|
// template for secret list items
|
||||||
var tmplSecretList = "\x1b[33m{{ .Name }} \x1b[0m" + `
|
var tmplSecretList = "\x1b[33m{{ .Name }} \x1b[0m" + `
|
||||||
Events: {{ list .Events }}
|
Events: {{ list .Events }}
|
||||||
SkipVerify: {{ .SkipVerify }}
|
{{- if .Images }}
|
||||||
Conceal: {{ .Conceal }}
|
Images: {{ list .Images }}
|
||||||
|
{{- else }}
|
||||||
|
Images: <any>
|
||||||
|
{{- end }}
|
||||||
`
|
`
|
||||||
|
|
||||||
var secretFuncMap = template.FuncMap{
|
var secretFuncMap = template.FuncMap{
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
package model
|
|
||||||
|
|
||||||
type Agent struct {
|
|
||||||
ID int64 `json:"id" meddler:"agent_id,pk"`
|
|
||||||
Address string `json:"address" meddler:"agent_addr"`
|
|
||||||
Platform string `json:"platform" meddler:"agent_platform"`
|
|
||||||
Capacity int `json:"capacity" meddler:"agent_capacity"`
|
|
||||||
Created int64 `json:"created_at" meddler:"agent_created"`
|
|
||||||
Updated int64 `json:"updated_at" meddler:"agent_updated"`
|
|
||||||
}
|
|
17
model/approval.go
Normal file
17
model/approval.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
type (
|
||||||
|
// ApprovalStore persists approved committers to storage.
|
||||||
|
ApprovalStore interface {
|
||||||
|
Approve(*Repo) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// Approval represents an approved committer.
|
||||||
|
Approval struct {
|
||||||
|
Username string `json:"username" meddler:"approval_username"`
|
||||||
|
Approved bool `json:"approved" meddler:"approval_approved"`
|
||||||
|
Comments string `json:"comments" meddler:"approval_comments"`
|
||||||
|
CreatedBy string `json:"created_by" meddler:"approval_created_by"`
|
||||||
|
CreatedAt int64 `json:"created_at" meddler:"approval_created_at"`
|
||||||
|
}
|
||||||
|
)
|
23
model/gate.go
Normal file
23
model/gate.go
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
// Gated indicates a build is gated and requires approval to proceed. It also
|
||||||
|
// includes the reason the build was gated.
|
||||||
|
type Gated struct {
|
||||||
|
Gated bool `json:"gated"`
|
||||||
|
Reason string `json:"reason"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GateService defines a service for gating builds.
|
||||||
|
type GateService interface {
|
||||||
|
Gated(*User, *Repo, *Build) (*Gated, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type gateService struct{}
|
||||||
|
|
||||||
|
func (s *gateService) Gated(owner *User, repo *Repo, build *Build) (*Gated, error) {
|
||||||
|
g := new(Gated)
|
||||||
|
if repo.IsPrivate && build.Event == EventPull && build.Sender != owner.Login {
|
||||||
|
g.Gated = true
|
||||||
|
}
|
||||||
|
return g, nil
|
||||||
|
}
|
17
model/job.go
17
model/job.go
|
@ -1,17 +0,0 @@
|
||||||
package model
|
|
||||||
|
|
||||||
// // swagger:model job
|
|
||||||
// type Job struct {
|
|
||||||
// ID int64 `json:"id" meddler:"job_id,pk"`
|
|
||||||
// BuildID int64 `json:"-" meddler:"job_build_id"`
|
|
||||||
// NodeID int64 `json:"-" meddler:"job_node_id"`
|
|
||||||
// Number int `json:"number" meddler:"job_number"`
|
|
||||||
// Error string `json:"error" meddler:"job_error"`
|
|
||||||
// Status string `json:"status" meddler:"job_status"`
|
|
||||||
// ExitCode int `json:"exit_code" meddler:"job_exit_code"`
|
|
||||||
// Enqueued int64 `json:"enqueued_at" meddler:"job_enqueued"`
|
|
||||||
// Started int64 `json:"started_at" meddler:"job_started"`
|
|
||||||
// Finished int64 `json:"finished_at" meddler:"job_finished"`
|
|
||||||
//
|
|
||||||
// Environment map[string]string `json:"environment" meddler:"job_environment,json"`
|
|
||||||
// }
|
|
164
server/hook.go
164
server/hook.go
|
@ -1,7 +1,6 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -164,67 +163,68 @@ func PostHook(c *gin.Context) {
|
||||||
logrus.Debugf("Error getting registry credentials for %s#%d. %s", repo.FullName, build.Number, err)
|
logrus.Debugf("Error getting registry credentials for %s#%d. %s", repo.FullName, build.Number, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mustApprove bool
|
// var mustApprove bool
|
||||||
if build.Event == model.EventPull {
|
// if build.Event == model.EventPull {
|
||||||
for _, sec := range secs {
|
// for _, sec := range secs {
|
||||||
if sec.SkipVerify {
|
// if sec.SkipVerify {
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
if sec.MatchEvent(model.EventPull) {
|
// if sec.MatchEvent(model.EventPull) {
|
||||||
mustApprove = true
|
// mustApprove = true
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if !mustApprove {
|
// if !mustApprove {
|
||||||
logrus.Debugf("no secrets exposed to pull_request: status: accepted")
|
// logrus.Debugf("no secrets exposed to pull_request: status: accepted")
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if build.Event == model.EventPull && mustApprove {
|
// if build.Event == model.EventPull && mustApprove {
|
||||||
old, ferr := remote_.FileRef(user, repo, build.Branch, repo.Config)
|
// old, ferr := remote_.FileRef(user, repo, build.Branch, repo.Config)
|
||||||
if ferr != nil {
|
// if ferr != nil {
|
||||||
build.Status = model.StatusBlocked
|
// build.Status = model.StatusBlocked
|
||||||
logrus.Debugf("cannot fetch base yaml: status: blocked")
|
// logrus.Debugf("cannot fetch base yaml: status: blocked")
|
||||||
} else if bytes.Equal(old, raw) {
|
// } else if bytes.Equal(old, raw) {
|
||||||
build.Status = model.StatusPending
|
// build.Status = model.StatusPending
|
||||||
logrus.Debugf("base yaml matches head yaml: status: accepted")
|
// logrus.Debugf("base yaml matches head yaml: status: accepted")
|
||||||
} else {
|
// } else {
|
||||||
// this block is executed if the target yaml file
|
// // this block is executed if the target yaml file
|
||||||
// does not match the base yaml.
|
// // does not match the base yaml.
|
||||||
|
//
|
||||||
// TODO unfortunately we have no good way to get the
|
// // TODO unfortunately we have no good way to get the
|
||||||
// sender repository permissions unless the user is
|
// // sender repository permissions unless the user is
|
||||||
// a registered drone user.
|
// // a registered drone user.
|
||||||
sender, uerr := store.GetUserLogin(c, build.Sender)
|
// sender, uerr := store.GetUserLogin(c, build.Sender)
|
||||||
if uerr != nil {
|
// if uerr != nil {
|
||||||
build.Status = model.StatusBlocked
|
// build.Status = model.StatusBlocked
|
||||||
logrus.Debugf("sender does not have a drone account: status: blocked")
|
// logrus.Debugf("sender does not have a drone account: status: blocked")
|
||||||
} else {
|
// } else {
|
||||||
if refresher, ok := remote_.(remote.Refresher); ok {
|
// if refresher, ok := remote_.(remote.Refresher); ok {
|
||||||
ok, _ := refresher.Refresh(sender)
|
// ok, _ := refresher.Refresh(sender)
|
||||||
if ok {
|
// if ok {
|
||||||
store.UpdateUser(c, sender)
|
// store.UpdateUser(c, sender)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// if the sender does not have push access to the
|
// // if the sender does not have push access to the
|
||||||
// repository the pull request should be blocked.
|
// // repository the pull request should be blocked.
|
||||||
perm, perr := remote_.Perm(sender, repo.Owner, repo.Name)
|
// perm, perr := remote_.Perm(sender, repo.Owner, repo.Name)
|
||||||
if perr == nil && perm.Push == true {
|
// if perr == nil && perm.Push == true {
|
||||||
build.Status = model.StatusPending
|
// build.Status = model.StatusPending
|
||||||
logrus.Debugf("sender %s has push access: status: accepted", sender.Login)
|
// logrus.Debugf("sender %s has push access: status: accepted", sender.Login)
|
||||||
} else {
|
// } else {
|
||||||
build.Status = model.StatusBlocked
|
// build.Status = model.StatusBlocked
|
||||||
logrus.Debugf("sender %s does not have push access: status: blocked", sender.Login)
|
// logrus.Debugf("sender %s does not have push access: status: blocked", sender.Login)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
build.Status = model.StatusPending
|
// build.Status = model.StatusPending
|
||||||
}
|
// }
|
||||||
|
|
||||||
// update some build fields
|
// update some build fields
|
||||||
build.RepoID = repo.ID
|
build.RepoID = repo.ID
|
||||||
build.Verified = true
|
build.Verified = true
|
||||||
|
build.Status = model.StatusPending
|
||||||
|
|
||||||
if err := store.CreateBuild(c, build, build.Procs...); err != nil {
|
if err := store.CreateBuild(c, build, build.Procs...); err != nil {
|
||||||
logrus.Errorf("failure to save commit for %s. %s", repo.FullName, err)
|
logrus.Errorf("failure to save commit for %s. %s", repo.FullName, err)
|
||||||
|
@ -234,9 +234,9 @@ func PostHook(c *gin.Context) {
|
||||||
|
|
||||||
c.JSON(200, build)
|
c.JSON(200, build)
|
||||||
|
|
||||||
if build.Status == model.StatusBlocked {
|
// if build.Status == model.StatusBlocked {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// get the previous build so that we can send
|
// get the previous build so that we can send
|
||||||
// on status change notifications
|
// on status change notifications
|
||||||
|
@ -454,29 +454,28 @@ func (b *builder) Build() ([]*buildItem, error) {
|
||||||
for k, v := range metadata.EnvironDrone() {
|
for k, v := range metadata.EnvironDrone() {
|
||||||
environ[k] = v
|
environ[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range axis {
|
for k, v := range axis {
|
||||||
environ[k] = v
|
environ[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
secrets := map[string]string{}
|
var secrets []compiler.Secret
|
||||||
for _, sec := range b.Secs {
|
for _, sec := range b.Secs {
|
||||||
if !sec.MatchEvent(b.Curr.Event) {
|
if !sec.MatchEvent(b.Curr.Event) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if b.Curr.Verified || sec.SkipVerify {
|
if b.Curr.Verified || sec.SkipVerify {
|
||||||
secrets[sec.Name] = sec.Value
|
secrets = append(secrets, compiler.Secret{
|
||||||
|
Name: sec.Name,
|
||||||
|
Value: sec.Value,
|
||||||
|
Match: sec.Images,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub := func(name string) string {
|
|
||||||
if v, ok := environ[name]; ok {
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
return secrets[name]
|
|
||||||
}
|
|
||||||
|
|
||||||
y := b.Yaml
|
y := b.Yaml
|
||||||
s, err := envsubst.Eval(y, sub)
|
s, err := envsubst.Eval(y, func(name string) string {
|
||||||
|
return environ[name]
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -521,6 +520,7 @@ func (b *builder) Build() ([]*buildItem, error) {
|
||||||
b.Repo.IsPrivate,
|
b.Repo.IsPrivate,
|
||||||
),
|
),
|
||||||
compiler.WithRegistry(registries...),
|
compiler.WithRegistry(registries...),
|
||||||
|
compiler.WithSecret(secrets...),
|
||||||
compiler.WithPrefix(
|
compiler.WithPrefix(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"%d_%d",
|
"%d_%d",
|
||||||
|
@ -536,18 +536,18 @@ func (b *builder) Build() ([]*buildItem, error) {
|
||||||
compiler.WithMetadata(metadata),
|
compiler.WithMetadata(metadata),
|
||||||
).Compile(parsed)
|
).Compile(parsed)
|
||||||
|
|
||||||
for _, sec := range b.Secs {
|
// for _, sec := range b.Secs {
|
||||||
if !sec.MatchEvent(b.Curr.Event) {
|
// if !sec.MatchEvent(b.Curr.Event) {
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
if b.Curr.Verified || sec.SkipVerify {
|
// if b.Curr.Verified || sec.SkipVerify {
|
||||||
ir.Secrets = append(ir.Secrets, &backend.Secret{
|
// ir.Secrets = append(ir.Secrets, &backend.Secret{
|
||||||
Mask: sec.Conceal,
|
// Mask: sec.Conceal,
|
||||||
Name: sec.Name,
|
// Name: sec.Name,
|
||||||
Value: sec.Value,
|
// Value: sec.Value,
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
item := &buildItem{
|
item := &buildItem{
|
||||||
Proc: proc,
|
Proc: proc,
|
||||||
|
|
13
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/compiler.go
generated
vendored
13
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/compiler.go
generated
vendored
|
@ -20,6 +20,12 @@ type Registry struct {
|
||||||
Token string
|
Token string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Secret struct {
|
||||||
|
Name string
|
||||||
|
Value string
|
||||||
|
Match []string
|
||||||
|
}
|
||||||
|
|
||||||
// Compiler compiles the yaml
|
// Compiler compiles the yaml
|
||||||
type Compiler struct {
|
type Compiler struct {
|
||||||
local bool
|
local bool
|
||||||
|
@ -31,13 +37,16 @@ type Compiler struct {
|
||||||
path string
|
path string
|
||||||
metadata frontend.Metadata
|
metadata frontend.Metadata
|
||||||
registries []Registry
|
registries []Registry
|
||||||
|
secrets map[string]Secret
|
||||||
aliases []string
|
aliases []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new Compiler with options.
|
// New creates a new Compiler with options.
|
||||||
func New(opts ...Option) *Compiler {
|
func New(opts ...Option) *Compiler {
|
||||||
compiler := new(Compiler)
|
compiler := &Compiler{
|
||||||
compiler.env = map[string]string{}
|
env: map[string]string{},
|
||||||
|
secrets: map[string]Secret{},
|
||||||
|
}
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
opt(compiler)
|
opt(compiler)
|
||||||
}
|
}
|
||||||
|
|
20
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go
generated
vendored
20
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go
generated
vendored
|
@ -3,6 +3,7 @@ package compiler
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/cncd/pipeline/pipeline/backend"
|
"github.com/cncd/pipeline/pipeline/backend"
|
||||||
"github.com/cncd/pipeline/pipeline/frontend/yaml"
|
"github.com/cncd/pipeline/pipeline/frontend/yaml"
|
||||||
|
@ -73,7 +74,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen
|
||||||
if isPlugin(container) {
|
if isPlugin(container) {
|
||||||
paramsToEnv(container.Vargs, environment)
|
paramsToEnv(container.Vargs, environment)
|
||||||
|
|
||||||
if imageMatches(container.Image, c.escalated) {
|
if matchImage(container.Image, c.escalated...) {
|
||||||
privileged = true
|
privileged = true
|
||||||
entrypoint = []string{}
|
entrypoint = []string{}
|
||||||
command = []string{}
|
command = []string{}
|
||||||
|
@ -102,6 +103,13 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, requested := range container.Secrets.Secrets {
|
||||||
|
secret, ok := c.secrets[strings.ToLower(requested.Source)]
|
||||||
|
if ok && (len(secret.Match) == 0 || matchImage(image, secret.Match...)) {
|
||||||
|
environment[strings.ToUpper(requested.Target)] = secret.Value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return &backend.Step{
|
return &backend.Step{
|
||||||
Name: name,
|
Name: name,
|
||||||
Alias: container.Name,
|
Alias: container.Name,
|
||||||
|
@ -134,16 +142,6 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func imageMatches(image string, to []string) bool {
|
|
||||||
image = trimImage(image)
|
|
||||||
for _, i := range to {
|
|
||||||
if image == i {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func isPlugin(c *yaml.Container) bool {
|
func isPlugin(c *yaml.Container) bool {
|
||||||
return len(c.Vargs) != 0
|
return len(c.Vargs) != 0
|
||||||
}
|
}
|
||||||
|
|
10
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go
generated
vendored
10
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/option.go
generated
vendored
|
@ -39,6 +39,16 @@ func WithRegistry(registries ...Registry) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithSecret configures the compiler with external secrets
|
||||||
|
// to be injected into the container at runtime.
|
||||||
|
func WithSecret(secrets ...Secret) Option {
|
||||||
|
return func(compiler *Compiler) {
|
||||||
|
for _, secret := range secrets {
|
||||||
|
compiler.secrets[strings.ToLower(secret.Name)] = secret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WithMetadata configutes the compiler with the repostiory, build
|
// WithMetadata configutes the compiler with the repostiory, build
|
||||||
// and system metadata. The metadata is used to remove steps from
|
// and system metadata. The metadata is used to remove steps from
|
||||||
// the compiled pipeline configuration that should be skipped. The
|
// the compiled pipeline configuration that should be skipped. The
|
||||||
|
|
1
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go
generated
vendored
1
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go
generated
vendored
|
@ -52,6 +52,7 @@ type (
|
||||||
ShmSize libcompose.MemStringorInt `yaml:"shm_size,omitempty"`
|
ShmSize libcompose.MemStringorInt `yaml:"shm_size,omitempty"`
|
||||||
Ulimits libcompose.Ulimits `yaml:"ulimits,omitempty"`
|
Ulimits libcompose.Ulimits `yaml:"ulimits,omitempty"`
|
||||||
Volumes libcompose.Volumes `yaml:"volumes,omitempty"`
|
Volumes libcompose.Volumes `yaml:"volumes,omitempty"`
|
||||||
|
Secrets Secrets `yaml:"secrets,omitempty"`
|
||||||
Constraints Constraints `yaml:"when,omitempty"`
|
Constraints Constraints `yaml:"when,omitempty"`
|
||||||
Vargs map[string]interface{} `yaml:",inline"`
|
Vargs map[string]interface{} `yaml:",inline"`
|
||||||
}
|
}
|
||||||
|
|
30
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/secret.go
generated
vendored
Normal file
30
vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/secret.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
package yaml
|
||||||
|
|
||||||
|
type (
|
||||||
|
// Secrets defines a collection of secrets.
|
||||||
|
Secrets struct {
|
||||||
|
Secrets []*Secret
|
||||||
|
}
|
||||||
|
|
||||||
|
// Secret defines a container secret.
|
||||||
|
Secret struct {
|
||||||
|
Source string `yaml:"source"`
|
||||||
|
Target string `yaml:"target"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// UnmarshalYAML implements the Unmarshaller interface.
|
||||||
|
func (s *Secrets) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
|
var strslice []string
|
||||||
|
err := unmarshal(&strslice)
|
||||||
|
if err == nil {
|
||||||
|
for _, str := range strslice {
|
||||||
|
s.Secrets = append(s.Secrets, &Secret{
|
||||||
|
Source: str,
|
||||||
|
Target: str,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return unmarshal(&s.Secrets)
|
||||||
|
}
|
48
vendor/vendor.json
vendored
48
vendor/vendor.json
vendored
|
@ -28,68 +28,68 @@
|
||||||
{
|
{
|
||||||
"checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=",
|
"checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline",
|
"path": "github.com/cncd/pipeline/pipeline",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "Qu2FreqaMr8Yx2bW9O0cxAGgjr0=",
|
"checksumSHA1": "Qu2FreqaMr8Yx2bW9O0cxAGgjr0=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/backend",
|
"path": "github.com/cncd/pipeline/pipeline/backend",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "0CGXRaYwZhJxGIrGhn8WGpkFqPo=",
|
"checksumSHA1": "0CGXRaYwZhJxGIrGhn8WGpkFqPo=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/backend/docker",
|
"path": "github.com/cncd/pipeline/pipeline/backend/docker",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "/8wE+cVb7T4PQZgpLNu0DHzKGuE=",
|
"checksumSHA1": "/8wE+cVb7T4PQZgpLNu0DHzKGuE=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/frontend",
|
"path": "github.com/cncd/pipeline/pipeline/frontend",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "O0sulBQAHJeNLg3lO38Cq5uf/eg=",
|
"checksumSHA1": "QWs+L3emrt5DDTWvqD6rbMtLKMw=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml",
|
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "4gmWpW2MkXgWGSSvSoRFu1YjGbQ=",
|
"checksumSHA1": "Bsp5Fq7oc6ZDDX5COo//pajb0kk=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler",
|
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "Q0GkNUFamVYIA1Fd8r0A5M6Gx54=",
|
"checksumSHA1": "Q0GkNUFamVYIA1Fd8r0A5M6Gx54=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter",
|
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=",
|
"checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix",
|
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=",
|
"checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/interrupt",
|
"path": "github.com/cncd/pipeline/pipeline/interrupt",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=",
|
"checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/multipart",
|
"path": "github.com/cncd/pipeline/pipeline/multipart",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "TP5lK1T8cOKv5QjZ2nqdlYczSTo=",
|
"checksumSHA1": "TP5lK1T8cOKv5QjZ2nqdlYczSTo=",
|
||||||
"path": "github.com/cncd/pipeline/pipeline/rpc",
|
"path": "github.com/cncd/pipeline/pipeline/rpc",
|
||||||
"revision": "087d10834b19bbb8d1665152696ca63883610021",
|
"revision": "94d637b94d0439ed4853e8089d8a1b1820b67c65",
|
||||||
"revisionTime": "2017-04-06T15:46:03Z"
|
"revisionTime": "2017-04-09T09:45:58Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=",
|
"checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=",
|
||||||
|
|
Loading…
Reference in a new issue