2014-09-02 07:18:17 +00:00
|
|
|
package bitbucket
|
|
|
|
|
|
|
|
import (
|
2014-09-03 07:23:36 +00:00
|
|
|
"github.com/drone/config"
|
2014-09-02 07:18:17 +00:00
|
|
|
"github.com/drone/drone/plugin/remote"
|
|
|
|
)
|
|
|
|
|
2014-09-03 07:23:36 +00:00
|
|
|
var (
|
|
|
|
// Bitbucket cloud configuration details
|
|
|
|
bitbucketClient = config.String("bitbucket-client", "")
|
|
|
|
bitbucketSecret = config.String("bitbucket-secret", "")
|
|
|
|
)
|
|
|
|
|
|
|
|
// Registers the Bitbucket plugin using the default
|
|
|
|
// settings from the config file or environment
|
|
|
|
// variables.
|
|
|
|
func Register() {
|
|
|
|
if len(*bitbucketClient) == 0 || len(*bitbucketSecret) == 0 {
|
2014-09-02 07:18:17 +00:00
|
|
|
return
|
|
|
|
}
|
2014-09-03 07:23:36 +00:00
|
|
|
remote.Register(
|
|
|
|
NewDefault(*bitbucketClient, *bitbucketSecret),
|
|
|
|
)
|
2014-09-02 07:18:17 +00:00
|
|
|
}
|