Skip to content

Commit

Permalink
[jobs] Add job spec name to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel committed Jun 11, 2021
1 parent 3e3c39b commit 3fa6678
Show file tree
Hide file tree
Showing 11 changed files with 479 additions and 1,322 deletions.
23 changes: 16 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ module github.com/csweichel/werft
go 1.13

require (
cloud.google.com/go v0.56.0 // indirect
github.com/GeertJohan/go.rice v1.0.2
github.com/Masterminds/sprig/v3 v3.2.2
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect
github.com/alecthomas/repr v0.0.0-20210301060118-828286944d6a
github.com/buildkite/terminal-to-html v3.2.0+incompatible
github.com/containerd/containerd v1.4.1 // indirect
github.com/daaku/go.zipexe v1.0.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/docker/docker v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible // indirect
github.com/gogo/protobuf v1.3.2
github.com/golang-migrate/migrate/v4 v4.14.1
github.com/golang-migrate/migrate/v4 v4.11.0
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.2.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -19,9 +23,13 @@ require (
github.com/improbable-eng/grpc-web v0.14.0
github.com/lib/pq v1.10.0
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/olebedev/emitter v0.0.0-20190110104742-e8d1457e6aee
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/paulbellamy/ratecounter v0.2.0
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/segmentio/textio v1.2.0
github.com/sirupsen/logrus v1.8.1
Expand All @@ -33,12 +41,13 @@ require (
golang.org/x/text v0.3.5 // indirect
golang.org/x/tools v0.1.0
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e // indirect
google.golang.org/grpc v1.36.0
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/grpc v1.34.0-dev
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
k8s.io/api v0.20.4
k8s.io/apimachinery v0.20.4
k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
gotest.tools v2.2.0+incompatible // indirect
k8s.io/api v0.21.1
k8s.io/apimachinery v0.21.1
k8s.io/client-go v1.5.2
nhooyr.io/websocket v1.8.6 // indirect
)

Expand Down
356 changes: 33 additions & 323 deletions go.sum

Large diffs are not rendered by default.

223 changes: 116 additions & 107 deletions pkg/api/v1/werft.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/api/v1/werft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ message JobMetadata {
google.protobuf.Timestamp created = 4;
google.protobuf.Timestamp finished = 5;
repeated Annotation annotations = 6;
string job_spec_name = 7;
}

message Repository {
Expand Down
3 changes: 2 additions & 1 deletion pkg/werft/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ func (srv *Service) StartJob(ctx context.Context, req *v1.StartJobRequest) (resp
}
}
if tplpath != "" {
jobSpecName = strings.TrimSuffix(filepath.Base(tplpath), filepath.Ext(tplpath))
jobSpecName = strings.TrimSpace(strings.TrimSuffix(filepath.Base(tplpath), filepath.Ext(tplpath)))
}
md.JobSpecName = jobSpecName

// build job name
refname := md.Repository.Ref
Expand Down
261 changes: 66 additions & 195 deletions plugins/cron/go.sum

Large diffs are not rendered by default.

120 changes: 40 additions & 80 deletions plugins/github-integration/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/github-repo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ require (
github.com/google/go-github/v31 v31.0.0
github.com/sirupsen/logrus v1.8.1
google.golang.org/grpc v1.36.0
k8s.io/api v0.20.4
k8s.io/api v0.21.1
)
288 changes: 71 additions & 217 deletions plugins/github-repo/go.sum

Large diffs are not rendered by default.

261 changes: 66 additions & 195 deletions plugins/integration-example/go.sum

Large diffs are not rendered by default.

263 changes: 67 additions & 196 deletions plugins/webhook/go.sum

Large diffs are not rendered by default.

0 comments on commit 3fa6678

Please sign in to comment.