Pipeline path configurable

This commit is contained in:
Laszlo Fogas 2019-06-24 09:04:30 +02:00
parent e411893c62
commit 580b7b272f

View file

@ -1,6 +1,7 @@
package server package server
import ( import (
"strings"
"time" "time"
"github.com/laszlocph/drone-oss-08/model" "github.com/laszlocph/drone-oss-08/model"
@ -18,7 +19,8 @@ func (cf *configFetcher) Fetch() ([]*remote.FileMeta, error) {
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
select { select {
case <-time.After(time.Second * time.Duration(i)): case <-time.After(time.Second * time.Duration(i)):
file, fileerr := cf.remote_.File(cf.user, cf.repo, cf.build, cf.repo.Config) // either a file // either a file
file, fileerr := cf.remote_.File(cf.user, cf.repo, cf.build, cf.repo.Config)
if fileerr == nil { if fileerr == nil {
return []*remote.FileMeta{&remote.FileMeta{ return []*remote.FileMeta{&remote.FileMeta{
Name: cf.repo.Config, Name: cf.repo.Config,
@ -26,7 +28,8 @@ func (cf *configFetcher) Fetch() ([]*remote.FileMeta, error) {
}}, nil }}, nil
} }
dir, direrr := cf.remote_.Dir(cf.user, cf.repo, cf.build, ".drone") // or a folder // or a folder
dir, direrr := cf.remote_.Dir(cf.user, cf.repo, cf.build, strings.TrimSuffix(cf.repo.Config, "/"))
if direrr != nil { if direrr != nil {
return nil, direrr return nil, direrr
} }