mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 00:08:48 +00:00
got the build working correctly
This commit is contained in:
@@ -167,7 +167,7 @@ func (b *Builder) setup() error {
|
||||
src := filepath.Join(dir, "src")
|
||||
cmd := exec.Command("cp", "-a", b.Repo.Path, src)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("Error: Unable to copy repository. %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@ func (b *Buildfile) WriteHost(mapping string) {
|
||||
// code at the start.
|
||||
var base = `
|
||||
#!/bin/bash
|
||||
set +e
|
||||
|
||||
# drone configuration files are stored in /etc/drone.d
|
||||
# execute these files prior to our build to set global
|
||||
|
@@ -81,6 +81,10 @@ func (g *Github) GetHook(r *http.Request) (*remote.Hook, error) {
|
||||
hook.Sha = data.Head.Id
|
||||
hook.Branch = data.Branch()
|
||||
|
||||
if len(hook.Owner) == 0 {
|
||||
hook.Owner = data.Repo.Owner.Name
|
||||
}
|
||||
|
||||
// extract the author and message from the commit
|
||||
// this is kind of experimental, since I don't know
|
||||
// what I'm doing here.
|
||||
@@ -114,8 +118,7 @@ func (g *Github) GetPullRequestHook(r *http.Request) (*remote.Hook, error) {
|
||||
|
||||
// TODO we should also store the pull request branch (ie from x to y)
|
||||
// we can find it here: data.PullRequest.Head.Ref
|
||||
|
||||
return &remote.Hook{
|
||||
hook := remote.Hook{
|
||||
Owner: data.Repo.Owner.Login,
|
||||
Repo: data.Repo.Name,
|
||||
Sha: data.PullRequest.Head.Sha,
|
||||
@@ -125,7 +128,13 @@ func (g *Github) GetPullRequestHook(r *http.Request) (*remote.Hook, error) {
|
||||
Timestamp: time.Now().UTC().String(),
|
||||
Message: data.PullRequest.Title,
|
||||
PullRequest: strconv.Itoa(data.Number),
|
||||
}, nil
|
||||
}
|
||||
|
||||
if len(hook.Owner) == 0 {
|
||||
hook.Owner = data.Repo.Owner.Name
|
||||
}
|
||||
|
||||
return &hook, nil
|
||||
}
|
||||
|
||||
// GetLogin handles authentication to third party, remote services
|
||||
|
Reference in New Issue
Block a user