version tag
This commit is contained in:
parent
ba750ff0ae
commit
680afa1db1
2 changed files with 13 additions and 5 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/drone/drone/mock"
|
||||
"github.com/drone/drone/version"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/h2non/gock"
|
||||
)
|
||||
|
@ -64,21 +65,21 @@ var sample = `{
|
|||
"points": [[915148800, 10]],
|
||||
"type": "gauge",
|
||||
"host": "test.example.com",
|
||||
"tags": ["remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
"tags": ["version:` + version.Version.String() + `","remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
},
|
||||
{
|
||||
"metric": "drone.repos",
|
||||
"points": [[915148800, 20]],
|
||||
"type": "gauge",
|
||||
"host": "test.example.com",
|
||||
"tags": ["remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
"tags": ["version:` + version.Version.String() + `","remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
},
|
||||
{
|
||||
"metric": "drone.builds",
|
||||
"points": [[915148800, 30]],
|
||||
"type": "gauge",
|
||||
"host": "test.example.com",
|
||||
"tags": ["remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
"tags": ["version:` + version.Version.String() + `","remote:github:cloud","scheduler:internal:agents","license:trial"]
|
||||
}
|
||||
]
|
||||
}`
|
||||
|
|
|
@ -6,10 +6,17 @@
|
|||
|
||||
package sink
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/drone/drone/version"
|
||||
)
|
||||
|
||||
func createTags(config Config) []string {
|
||||
var tags []string
|
||||
tags := []string{
|
||||
fmt.Sprintf("version:%s", version.Version),
|
||||
}
|
||||
|
||||
switch {
|
||||
case config.EnableBitbucket:
|
||||
tags = append(tags, "remote:bitbucket:cloud")
|
||||
|
|
Loading…
Reference in a new issue