浏览代码

Pull&commit after pushing to Grafana

父节点
当前提交
5ce8802366
签署人:: Brendan Abolivier <contact@brendanabolivier.com> GPG 密钥 ID: 8EF1500759F70623
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      src/pusher/webhook.go

+ 10
- 0
src/pusher/webhook.go 查看文件

5
 	"strconv"
5
 	"strconv"
6
 	"strings"
6
 	"strings"
7
 
7
 
8
+	puller "puller"
9
+
8
 	"gopkg.in/go-playground/webhooks.v3"
10
 	"gopkg.in/go-playground/webhooks.v3"
9
 	"gopkg.in/go-playground/webhooks.v3/gitlab"
11
 	"gopkg.in/go-playground/webhooks.v3/gitlab"
10
 )
12
 )
42
 		// TODO: Remove a dashboard when its file gets deleted?
44
 		// TODO: Remove a dashboard when its file gets deleted?
43
 	}
45
 	}
44
 
46
 
47
+	// Grafana will auto-update the version number after we pushed the new
48
+	// dashboards, so we use the puller mechanic to pull the updated numbers and
49
+	// commit them in the git repo.
50
+	if err = puller.PullGrafanaAndCommit(
51
+		grafanaClient, *repoURL, *clonePath, *privateKeyPath,
52
+	); err != nil {
53
+		panic(err)
54
+	}
45
 }
55
 }
46
 
56
 
47
 func pushFile(filename string) error {
57
 func pushFile(filename string) error {