mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
refactored how remotes work and how (some) config is loaded
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
package gitlab
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/drone/config"
|
||||
"github.com/drone/drone/plugin/remote"
|
||||
)
|
||||
|
||||
// registers the Gitlab plugin
|
||||
func init() {
|
||||
var url = os.Getenv("GITLAB_URL")
|
||||
if len(url) == 0 {
|
||||
var (
|
||||
gitlabURL = config.String("gitlab-url", "")
|
||||
)
|
||||
|
||||
// Registers the Gitlab plugin using the default
|
||||
// settings from the config file or environment
|
||||
// variables.
|
||||
func Register() {
|
||||
if len(*gitlabURL) == 0 {
|
||||
return
|
||||
}
|
||||
remote.Register(New(url))
|
||||
remote.Register(
|
||||
New(*gitlabURL),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user