|
@@ -21,7 +21,10 @@ type diffVersion struct {
|
21
|
21
|
// PullGrafanaAndCommit pulls all the dashboards from Grafana then commits each
|
22
|
22
|
// of them to Git except for those that have a newer or equal version number
|
23
|
23
|
// already versionned in the repo
|
24
|
|
-func PullGrafanaAndCommit(client *grafana.Client) error {
|
|
24
|
+func PullGrafanaAndCommit(
|
|
25
|
+ client *grafana.Client,
|
|
26
|
+ repoURL string, clonePath string, privateKeyPath string,
|
|
27
|
+) error {
|
25
|
28
|
dv := make(map[string]diffVersion)
|
26
|
29
|
|
27
|
30
|
dbVersions, err := getDashboardsVersions()
|
|
@@ -29,7 +32,7 @@ func PullGrafanaAndCommit(client *grafana.Client) error {
|
29
|
32
|
return err
|
30
|
33
|
}
|
31
|
34
|
|
32
|
|
- repo, err := git.Sync(*repoURL, *clonePath, *privateKeyPath)
|
|
35
|
+ repo, err := git.Sync(repoURL, clonePath, privateKeyPath)
|
33
|
36
|
if err != nil {
|
34
|
37
|
return err
|
35
|
38
|
}
|
|
@@ -74,7 +77,7 @@ func PullGrafanaAndCommit(client *grafana.Client) error {
|
74
|
77
|
}
|
75
|
78
|
}
|
76
|
79
|
|
77
|
|
- if err = git.Push(repo, *privateKeyPath); err != nil {
|
|
80
|
+ if err = git.Push(repo, privateKeyPath); err != nil {
|
78
|
81
|
return err
|
79
|
82
|
}
|
80
|
83
|
|