mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 05:41:12 +00:00
4276a04f0c
Completely switch to zerolog (Remove usage of logrus and std logger) Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
26 lines
572 B
Go
26 lines
572 B
Go
package environments
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/woodpecker-ci/woodpecker/server/model"
|
|
)
|
|
|
|
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
|
|
}
|