mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 10:21:00 +00:00
e3499f610d
* pass context down to remote clients * make tests work * add ctx to Refresh() and use it * bitbucketserver * code format * plugin interface: add todo context * solve todo * RM TODO by using context.WithTimeout * refactor & fix * Apply suggestions from code review Co-authored-by: Anbraten <anton@ju60.de> * go fmt * Update server/remote/coding/coding.go Co-authored-by: Anbraten <anton@ju60.de> Co-authored-by: Anbraten <anton@ju60.de>
25 lines
571 B
Go
25 lines
571 B
Go
package environments
|
|
|
|
import (
|
|
"github.com/woodpecker-ci/woodpecker/server/model"
|
|
"strings"
|
|
)
|
|
|
|
type builtin struct {
|
|
globals []*model.Environ
|
|
}
|
|
|
|
// Filesystem returns a new local registry service.
|
|
func Filesystem(params []string) model.EnvironService {
|
|
var globals []*model.Environ
|
|
|
|
for _, item := range params {
|
|
kvPair := strings.SplitN(item, ":", 2)
|
|
globals = append(globals, &model.Environ{Name: kvPair[0], Value: kvPair[1]})
|
|
}
|
|
return &builtin{globals}
|
|
}
|
|
|
|
func (b *builtin) EnvironList(repo *model.Repo) ([]*model.Environ, error) {
|
|
return b.globals, nil
|
|
}
|