mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-18 08:26:45 +02:00
26 lines
553 B
Go
26 lines
553 B
Go
|
package environments
|
||
|
|
||
|
import (
|
||
|
"github.com/laszlocph/woodpecker/model"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
type builtin struct {
|
||
|
globals []*model.Environ
|
||
|
}
|
||
|
|
||
|
// New 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
|
||
|
}
|