mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 19:31:05 +00:00
add constructor for Builder
this makes it easier to track required dependencies as they change (todo: actually, like, use it for required dependencies)
This commit is contained in:
parent
0e98f294a3
commit
fc01782554
3 changed files with 9 additions and 5 deletions
|
@ -174,7 +174,7 @@ func run(path string) {
|
|||
|
||||
// loop through and create builders
|
||||
for _, b := range builds { //script.Builds {
|
||||
builder := build.Builder{}
|
||||
builder := build.New()
|
||||
builder.Build = b
|
||||
builder.Repo = &code
|
||||
builder.Key = key
|
||||
|
@ -186,7 +186,7 @@ func run(path string) {
|
|||
builder.Stdout = &buf
|
||||
}
|
||||
|
||||
builders = append(builders, &builder)
|
||||
builders = append(builders, builder)
|
||||
}
|
||||
|
||||
switch *parallel {
|
||||
|
|
|
@ -35,6 +35,10 @@ type BuildState struct {
|
|||
// Max RAM, Max Swap, Disk space, and more.
|
||||
}
|
||||
|
||||
func New() *Builder {
|
||||
return &Builder{}
|
||||
}
|
||||
|
||||
// Builder represents a build process being prepared
|
||||
// to run.
|
||||
type Builder struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package queue
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
bldr "github.com/drone/drone/pkg/build"
|
||||
"github.com/drone/drone/pkg/build"
|
||||
"github.com/drone/drone/pkg/build/git"
|
||||
r "github.com/drone/drone/pkg/build/repo"
|
||||
"github.com/drone/drone/pkg/build/script"
|
||||
|
@ -134,7 +134,7 @@ func (b *BuildTask) execute() error {
|
|||
}
|
||||
|
||||
// execute the build
|
||||
builder := bldr.Builder{}
|
||||
builder := build.New()
|
||||
builder.Build = b.Script
|
||||
builder.Repo = &r.Repo{Path: b.Repo.URL, Branch: b.Commit.Branch, Commit: b.Commit.Hash, PR: b.Commit.PullRequest, Dir: filepath.Join("/var/cache/drone/src", b.Repo.Slug), Depth: git.GitDepth(b.Script.Git)}
|
||||
builder.Key = []byte(b.Repo.PrivateKey)
|
||||
|
@ -225,7 +225,7 @@ func updateGitHubStatus(repo *Repo, commit *Commit) error {
|
|||
}
|
||||
|
||||
client := github.New(user.GithubToken)
|
||||
client.ApiUrl = settings.GitHubApiUrl;
|
||||
client.ApiUrl = settings.GitHubApiUrl
|
||||
|
||||
var url string
|
||||
url = settings.URL().String() + "/" + repo.Slug + "/commit/" + commit.Hash
|
||||
|
|
Loading…
Reference in a new issue