mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 22:03:59 +00:00
Make pipeline runtime log with description (#970)
* introduce runtime descriptors to pipeline runtime * nit return orig error at traceStep() * more logging * refactor Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
This commit is contained in:
@@ -81,17 +81,20 @@ func (r *Runner) Run(ctx context.Context) error {
|
||||
timeout = time.Duration(minutes) * time.Minute
|
||||
}
|
||||
|
||||
repoName := extractRepositoryName(work.Config) // hack
|
||||
buildNumber := extractBuildNumber(work.Config) // hack
|
||||
|
||||
r.counter.Add(
|
||||
work.ID,
|
||||
timeout,
|
||||
extractRepositoryName(work.Config), // hack
|
||||
extractBuildNumber(work.Config), // hack
|
||||
repoName,
|
||||
buildNumber,
|
||||
)
|
||||
defer r.counter.Done(work.ID)
|
||||
|
||||
logger := log.With().
|
||||
Str("repo", extractRepositoryName(work.Config)). // hack
|
||||
Str("build", extractBuildNumber(work.Config)). // hack
|
||||
Str("repo", repoName).
|
||||
Str("build", buildNumber).
|
||||
Str("id", work.ID).
|
||||
Logger()
|
||||
|
||||
@@ -308,6 +311,11 @@ func (r *Runner) Run(ctx context.Context) error {
|
||||
pipeline.WithLogger(defaultLogger),
|
||||
pipeline.WithTracer(defaultTracer),
|
||||
pipeline.WithEngine(*r.engine),
|
||||
pipeline.WithDescription(map[string]string{
|
||||
"ID": work.ID,
|
||||
"Repo": repoName,
|
||||
"Build": buildNumber,
|
||||
}),
|
||||
).Run()
|
||||
|
||||
state.Finished = time.Now().Unix()
|
||||
|
Reference in New Issue
Block a user