-
Notifications
You must be signed in to change notification settings - Fork 18
/
Magefile.go
42 lines (33 loc) · 882 Bytes
/
Magefile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//go:build mage
// +build mage
package main
import (
"github.com/magefile/mage/sh"
)
// Build builds the binaries.
func Build() error {
return sh.RunV("go", "build", "./...")
}
// Test runs the test suite.
func Test() error {
return sh.RunV("go", "test", "./...")
}
func Lint() error {
if err := sh.RunV("golangci-lint", "run", "./..."); err != nil {
return err
}
return nil
}
// Drone signs the Drone configuration file
// This needs to be run everytime the drone.yml file is modified
// See https://github.com/grafana/deployment_tools/blob/master/docs/infrastructure/drone/signing.md for more info
func Drone() error {
if err := sh.RunV("drone", "lint"); err != nil {
return err
}
if err := sh.RunV("drone", "--server", "https://drone.grafana.net", "sign", "--save", "grafana/grafana-aws-sdk"); err != nil {
return err
}
return nil
}
var Default = Build