2014-09-28 03:36:11 +00:00
|
|
|
package gogs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/drone/config"
|
|
|
|
"github.com/drone/drone/plugin/remote"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
gogsUrl = config.String("gogs-url", "")
|
|
|
|
gogsSecret = config.String("gogs-secret", "")
|
2015-01-12 22:59:06 +00:00
|
|
|
gogsOpen = config.Bool("gogs-open", false)
|
2014-09-28 03:36:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Registers the Gogs plugin using the default
|
|
|
|
// settings from the config file or environment
|
|
|
|
// variables.
|
|
|
|
func Register() {
|
|
|
|
if len(*gogsUrl) == 0 {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
remote.Register(
|
2015-01-12 22:59:06 +00:00
|
|
|
New(*gogsUrl, *gogsSecret, *gogsOpen),
|
2014-09-28 03:36:11 +00:00
|
|
|
)
|
|
|
|
}
|