mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-22 16:36:30 +00:00
move clone path calc due to panic
This commit is contained in:
parent
1947657e25
commit
164c0c6a8e
3 changed files with 13 additions and 11 deletions
3
Makefile
3
Makefile
|
@ -45,6 +45,9 @@ bindata:
|
|||
bindata_debug:
|
||||
$$GOPATH/bin/go-bindata --debug -o="cmd/drone-server/drone_bindata.go" cmd/drone-server/static/...
|
||||
|
||||
docker:
|
||||
docker build --file=cmd/drone-build/Dockerfile.alpine --rm=true -t drone/drone-build .
|
||||
|
||||
# creates a debian package for drone
|
||||
# to install `sudo dpkg -i drone.deb`
|
||||
dist:
|
||||
|
|
|
@ -58,6 +58,7 @@ func main() {
|
|||
|
||||
// performs some initial parsing and pre-processing steps
|
||||
// prior to executing our build tasks.
|
||||
createClone(ctx)
|
||||
err = setup(ctx)
|
||||
if err != nil {
|
||||
log.Errorln("Error processing .drone.yml file.", err)
|
||||
|
@ -65,7 +66,6 @@ func main() {
|
|||
os.Exit(1)
|
||||
return
|
||||
}
|
||||
createClone(ctx)
|
||||
|
||||
var execs []execFunc
|
||||
if *clone {
|
||||
|
@ -128,15 +128,6 @@ func createClone(c *Context) error {
|
|||
// to the clone object for merge requests from bitbucket, gitlab, et al
|
||||
// if len(c.Commit.PullRequest) != 0 {
|
||||
// }
|
||||
pathv, ok := c.Conf.Clone.Config["path"]
|
||||
if ok {
|
||||
path, ok := pathv.(string)
|
||||
if ok {
|
||||
c.Clone.Dir = path
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Workspace path not found")
|
||||
}
|
||||
|
||||
func parseContext() (*Context, error) {
|
||||
|
|
|
@ -62,7 +62,15 @@ func setup(c *Context) error {
|
|||
c.Conf.Build.Environment = append(c.Conf.Build.Environment, env)
|
||||
}
|
||||
|
||||
pathv, ok := c.Conf.Clone.Config["path"]
|
||||
if ok {
|
||||
path, ok := pathv.(string)
|
||||
if ok {
|
||||
c.Clone.Dir = path
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Workspace path not found")
|
||||
}
|
||||
|
||||
type execFunc func(c *Context) (int, error)
|
||||
|
|
Loading…
Reference in a new issue