mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 06:13:24 +00:00
Rename build
to pipeline
in code (#1224)
Ref: #745 Co-authored-by: Anbraten <anton@ju60.de> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -47,15 +48,15 @@ func GetBadge(c *gin.Context) {
|
||||
branch = repo.Branch
|
||||
}
|
||||
|
||||
build, err := _store.GetBuildLast(repo, branch)
|
||||
pipeline, err := _store.GetPipelineLast(repo, branch)
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("")
|
||||
build = nil
|
||||
pipeline = nil
|
||||
}
|
||||
|
||||
// we serve an SVG, so set content type appropriately.
|
||||
c.Writer.Header().Set("Content-Type", "image/svg+xml")
|
||||
c.String(http.StatusOK, badges.Generate(build))
|
||||
c.String(http.StatusOK, badges.Generate(pipeline))
|
||||
}
|
||||
|
||||
func GetCC(c *gin.Context) {
|
||||
@@ -66,13 +67,13 @@ func GetCC(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
builds, err := _store.GetBuildList(repo, 1)
|
||||
if err != nil || len(builds) == 0 {
|
||||
pipelines, err := _store.GetPipelineList(repo, 1)
|
||||
if err != nil || len(pipelines) == 0 {
|
||||
c.AbortWithStatus(404)
|
||||
return
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s/%s/%d", server.Config.Server.Host, repo.FullName, builds[0].Number)
|
||||
cc := ccmenu.New(repo, builds[0], url)
|
||||
url := fmt.Sprintf("%s/%s/%d", server.Config.Server.Host, repo.FullName, pipelines[0].Number)
|
||||
cc := ccmenu.New(repo, pipelines[0], url)
|
||||
c.XML(200, cc)
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -27,7 +28,7 @@ import (
|
||||
"github.com/woodpecker-ci/woodpecker/server/store"
|
||||
)
|
||||
|
||||
// FileList gets a list file by build.
|
||||
// FileList gets a list file by pipeline.
|
||||
func FileList(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
num, err := strconv.ParseInt(c.Param("number"), 10, 64)
|
||||
@@ -37,13 +38,13 @@ func FileList(c *gin.Context) {
|
||||
}
|
||||
|
||||
repo := session.Repo(c)
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pipeline, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
files, err := _store.FileList(build)
|
||||
files, err := _store.FileList(pipeline)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
@@ -76,13 +77,13 @@ func FileGet(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pipeline, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
proc, err := _store.ProcFind(build, pid)
|
||||
proc, err := _store.ProcFind(pipeline, pid)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -79,7 +80,7 @@ func PostHook(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if tmpBuild == nil {
|
||||
msg := "ignoring hook: hook parsing resulted in empty build"
|
||||
msg := "ignoring hook: hook parsing resulted in empty pipeline"
|
||||
log.Debug().Msg(msg)
|
||||
c.String(http.StatusOK, msg)
|
||||
return
|
||||
@@ -174,10 +175,10 @@ func PostHook(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
build, err := pipeline.Create(c, _store, repo, tmpBuild)
|
||||
pl, err := pipeline.Create(c, _store, repo, tmpBuild)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(200, build)
|
||||
c.JSON(200, pl)
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -37,11 +38,11 @@ import (
|
||||
"github.com/woodpecker-ci/woodpecker/server/store"
|
||||
)
|
||||
|
||||
func CreateBuild(c *gin.Context) {
|
||||
func CreatePipeline(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
|
||||
var p model.BuildOptions
|
||||
var p model.PipelineOptions
|
||||
|
||||
err := json.NewDecoder(c.Request.Body).Decode(&p)
|
||||
if err != nil {
|
||||
@@ -53,25 +54,25 @@ func CreateBuild(c *gin.Context) {
|
||||
|
||||
lastCommit, _ := server.Config.Services.Remote.BranchHead(c, user, repo, p.Branch)
|
||||
|
||||
tmpBuild := createTmpBuild(model.EventManual, lastCommit, repo, user, &p)
|
||||
tmpBuild := createTmpPipeline(model.EventManual, lastCommit, repo, user, &p)
|
||||
|
||||
build, err := pipeline.Create(c, _store, repo, tmpBuild)
|
||||
pl, err := pipeline.Create(c, _store, repo, tmpBuild)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(http.StatusOK, build)
|
||||
c.JSON(http.StatusOK, pl)
|
||||
}
|
||||
}
|
||||
|
||||
func createTmpBuild(event model.WebhookEvent, commitSHA string, repo *model.Repo, user *model.User, opts *model.BuildOptions) *model.Build {
|
||||
return &model.Build{
|
||||
func createTmpPipeline(event model.WebhookEvent, commitSHA string, repo *model.Repo, user *model.User, opts *model.PipelineOptions) *model.Pipeline {
|
||||
return &model.Pipeline{
|
||||
Event: event,
|
||||
Commit: commitSHA,
|
||||
Branch: opts.Branch,
|
||||
Timestamp: time.Now().UTC().Unix(),
|
||||
|
||||
Avatar: user.Avatar,
|
||||
Message: "MANUAL BUILD @ " + opts.Branch,
|
||||
Message: "MANUAL PIPELINE @ " + opts.Branch,
|
||||
|
||||
Ref: opts.Branch,
|
||||
AdditionalVariables: opts.Variables,
|
||||
@@ -84,7 +85,7 @@ func createTmpBuild(event model.WebhookEvent, commitSHA string, repo *model.Repo
|
||||
}
|
||||
}
|
||||
|
||||
func GetBuilds(c *gin.Context) {
|
||||
func GetPipelines(c *gin.Context) {
|
||||
repo := session.Repo(c)
|
||||
page, err := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
if err != nil {
|
||||
@@ -92,18 +93,18 @@ func GetBuilds(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
builds, err := store.FromContext(c).GetBuildList(repo, page)
|
||||
pipelines, err := store.FromContext(c).GetPipelineList(repo, page)
|
||||
if err != nil {
|
||||
c.AbortWithStatus(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, builds)
|
||||
c.JSON(http.StatusOK, pipelines)
|
||||
}
|
||||
|
||||
func GetBuild(c *gin.Context) {
|
||||
func GetPipeline(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
if c.Param("number") == "latest" {
|
||||
GetBuildLast(c)
|
||||
GetPipelineLast(c)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -114,62 +115,62 @@ func GetBuild(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
files, _ := _store.FileList(build)
|
||||
procs, _ := _store.ProcList(build)
|
||||
if build.Procs, err = model.Tree(procs); err != nil {
|
||||
files, _ := _store.FileList(pl)
|
||||
procs, _ := _store.ProcList(pl)
|
||||
if pl.Procs, err = model.Tree(procs); err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
build.Files = files
|
||||
pl.Files = files
|
||||
|
||||
c.JSON(http.StatusOK, build)
|
||||
c.JSON(http.StatusOK, pl)
|
||||
}
|
||||
|
||||
func GetBuildLast(c *gin.Context) {
|
||||
func GetPipelineLast(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
branch := c.DefaultQuery("branch", repo.Branch)
|
||||
|
||||
build, err := _store.GetBuildLast(repo, branch)
|
||||
pl, err := _store.GetPipelineLast(repo, branch)
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
procs, err := _store.ProcList(build)
|
||||
procs, err := _store.ProcList(pl)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
if build.Procs, err = model.Tree(procs); err != nil {
|
||||
if pl.Procs, err = model.Tree(procs); err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, build)
|
||||
c.JSON(http.StatusOK, pl)
|
||||
}
|
||||
|
||||
func GetBuildLogs(c *gin.Context) {
|
||||
func GetPipelineLogs(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
|
||||
// parse the build number and job sequence number from
|
||||
// parse the pipeline number and job sequence number from
|
||||
// the request parameter.
|
||||
num, _ := strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
ppid, _ := strconv.Atoi(c.Params.ByName("pid"))
|
||||
name := c.Params.ByName("proc")
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
}
|
||||
|
||||
proc, err := _store.ProcChild(build, ppid, name)
|
||||
proc, err := _store.ProcChild(pl, ppid, name)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
@@ -193,18 +194,18 @@ func GetProcLogs(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
|
||||
// parse the build number and job sequence number from
|
||||
// parse the pipeline number and job sequence number from
|
||||
// the request parameter.
|
||||
num, _ := strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
pid, _ := strconv.Atoi(c.Params.ByName("pid"))
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusNotFound, err)
|
||||
return
|
||||
}
|
||||
|
||||
proc, err := _store.ProcFind(build, pid)
|
||||
proc, err := _store.ProcFind(pl, pid)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusNotFound, err)
|
||||
return
|
||||
@@ -224,7 +225,7 @@ func GetProcLogs(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func GetBuildConfig(c *gin.Context) {
|
||||
func GetPipelineConfig(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
num, err := strconv.ParseInt(c.Param("number"), 10, 64)
|
||||
@@ -233,13 +234,13 @@ func GetBuildConfig(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
configs, err := _store.ConfigsForBuild(build.ID)
|
||||
configs, err := _store.ConfigsForPipeline(pl.ID)
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
@@ -248,19 +249,19 @@ func GetBuildConfig(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, configs)
|
||||
}
|
||||
|
||||
// DeleteBuild cancels a build
|
||||
func DeleteBuild(c *gin.Context) {
|
||||
// DeletePipeline cancels a pipeline
|
||||
func DeletePipeline(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
num, _ := strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusNotFound, err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := pipeline.Cancel(c, _store, repo, build); err != nil {
|
||||
if err := pipeline.Cancel(c, _store, repo, pl); err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.Status(http.StatusNoContent)
|
||||
@@ -276,17 +277,17 @@ func PostApproval(c *gin.Context) {
|
||||
num, _ = strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
)
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
}
|
||||
|
||||
newBuild, err := pipeline.Approve(c, _store, build, user, repo)
|
||||
newpipeline, err := pipeline.Approve(c, _store, pl, user, repo)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(200, newBuild)
|
||||
c.JSON(200, newpipeline)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,31 +300,31 @@ func PostDecline(c *gin.Context) {
|
||||
num, _ = strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
)
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
c.String(http.StatusNotFound, "%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
build, err = pipeline.Decline(c, _store, build, user, repo)
|
||||
pl, err = pipeline.Decline(c, _store, pl, user, repo)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(200, build)
|
||||
c.JSON(200, pl)
|
||||
}
|
||||
}
|
||||
|
||||
func GetBuildQueue(c *gin.Context) {
|
||||
out, err := store.FromContext(c).GetBuildQueue()
|
||||
func GetPipelineQueue(c *gin.Context) {
|
||||
out, err := store.FromContext(c).GetPipelineQueue()
|
||||
if err != nil {
|
||||
c.String(500, "Error getting build queue. %s", err)
|
||||
c.String(500, "Error getting pipeline queue. %s", err)
|
||||
return
|
||||
}
|
||||
c.JSON(200, out)
|
||||
}
|
||||
|
||||
// PostBuild restarts a build optional with altered event, deploy or environment
|
||||
func PostBuild(c *gin.Context) {
|
||||
// PostPipeline restarts a pipeline optional with altered event, deploy or environment
|
||||
func PostPipeline(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
repo := session.Repo(c)
|
||||
|
||||
@@ -340,9 +341,9 @@ func PostBuild(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
log.Error().Msgf("failure to get build %d. %s", num, err)
|
||||
log.Error().Msgf("failure to get pipeline %d. %s", num, err)
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
}
|
||||
@@ -351,20 +352,20 @@ func PostBuild(c *gin.Context) {
|
||||
refreshUserToken(c, user)
|
||||
|
||||
// make Deploy overridable
|
||||
build.Deploy = c.DefaultQuery("deploy_to", build.Deploy)
|
||||
pl.Deploy = c.DefaultQuery("deploy_to", pl.Deploy)
|
||||
|
||||
// make Event overridable
|
||||
if event, ok := c.GetQuery("event"); ok {
|
||||
build.Event = model.WebhookEvent(event)
|
||||
pl.Event = model.WebhookEvent(event)
|
||||
|
||||
if !model.ValidateWebhookEvent(build.Event) {
|
||||
msg := fmt.Sprintf("build event '%s' is invalid", event)
|
||||
if !model.ValidateWebhookEvent(pl.Event) {
|
||||
msg := fmt.Sprintf("pipeline event '%s' is invalid", event)
|
||||
c.String(http.StatusBadRequest, msg)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Read query string parameters into buildParams, exclude reserved params
|
||||
// Read query string parameters into pipelineParams, exclude reserved params
|
||||
envs := map[string]string{}
|
||||
for key, val := range c.Request.URL.Query() {
|
||||
switch key {
|
||||
@@ -372,43 +373,43 @@ func PostBuild(c *gin.Context) {
|
||||
case "fork", "event", "deploy_to":
|
||||
continue
|
||||
default:
|
||||
// We only accept string literals, because build parameters will be
|
||||
// We only accept string literals, because pipeline parameters will be
|
||||
// injected as environment variables
|
||||
// TODO: sanitize the value
|
||||
envs[key] = val[0]
|
||||
}
|
||||
}
|
||||
|
||||
newBuild, err := pipeline.Restart(c, _store, build, user, repo, envs)
|
||||
newpipeline, err := pipeline.Restart(c, _store, pl, user, repo, envs)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(200, newBuild)
|
||||
c.JSON(200, newpipeline)
|
||||
}
|
||||
}
|
||||
|
||||
func DeleteBuildLogs(c *gin.Context) {
|
||||
func DeletePipelineLogs(c *gin.Context) {
|
||||
_store := store.FromContext(c)
|
||||
|
||||
repo := session.Repo(c)
|
||||
user := session.User(c)
|
||||
num, _ := strconv.ParseInt(c.Params.ByName("number"), 10, 64)
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, num)
|
||||
pl, err := _store.GetPipelineNumber(repo, num)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
}
|
||||
|
||||
procs, err := _store.ProcList(build)
|
||||
procs, err := _store.ProcList(pl)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(404, err)
|
||||
return
|
||||
}
|
||||
|
||||
switch build.Status {
|
||||
switch pl.Status {
|
||||
case model.StatusRunning, model.StatusPending:
|
||||
c.String(400, "Cannot delete logs for a pending or running build")
|
||||
c.String(400, "Cannot delete logs for a pending or running pipeline")
|
||||
return
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -33,7 +34,7 @@ import (
|
||||
|
||||
// TODO: make it set system wide via environment variables
|
||||
const (
|
||||
defaultTimeout int64 = 60 // 1 hour default build time
|
||||
defaultTimeout int64 = 60 // 1 hour default pipeline time
|
||||
maxTimeout int64 = defaultTimeout * 2
|
||||
)
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// Copyright 2022 Woodpecker Authors
|
||||
// Copyright 2018 Drone.IO Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -140,18 +141,18 @@ func LogStreamSSE(c *gin.Context) {
|
||||
repo := session.Repo(c)
|
||||
_store := store.FromContext(c)
|
||||
|
||||
// // parse the build number and job sequence number from
|
||||
// // parse the pipeline number and job sequence number from
|
||||
// // the repquest parameter.
|
||||
buildn, _ := strconv.ParseInt(c.Param("build"), 10, 64)
|
||||
pipelinen, _ := strconv.ParseInt(c.Param("pipeline"), 10, 64)
|
||||
jobn, _ := strconv.Atoi(c.Param("number"))
|
||||
|
||||
build, err := _store.GetBuildNumber(repo, buildn)
|
||||
pipeline, err := _store.GetPipelineNumber(repo, pipelinen)
|
||||
if err != nil {
|
||||
log.Debug().Msgf("stream cannot get build number: %v", err)
|
||||
logWriteStringErr(io.WriteString(rw, "event: error\ndata: build not found\n\n"))
|
||||
log.Debug().Msgf("stream cannot get pipeline number: %v", err)
|
||||
logWriteStringErr(io.WriteString(rw, "event: error\ndata: pipeline not found\n\n"))
|
||||
return
|
||||
}
|
||||
proc, err := _store.ProcFind(build, jobn)
|
||||
proc, err := _store.ProcFind(pipeline, jobn)
|
||||
if err != nil {
|
||||
log.Debug().Msgf("stream cannot get proc number: %v", err)
|
||||
logWriteStringErr(io.WriteString(rw, "event: error\ndata: process not found\n\n"))
|
||||
|
Reference in New Issue
Block a user