-
Notifications
You must be signed in to change notification settings - Fork 11
/
magefile.go
47 lines (37 loc) · 1023 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
43
44
45
46
47
//go:build mage
// +build mage
package main
import (
"get.porter.sh/magefiles/ci"
"get.porter.sh/magefiles/git"
"get.porter.sh/magefiles/porter"
"get.porter.sh/magefiles/tools"
"github.com/carolynvs/magex/mgx"
"github.com/carolynvs/magex/shx"
"github.com/magefile/mage/mg"
)
var must = shx.CommandBuilder{StopOnError: true}
func ConfigureAgent() {
mgx.Must(ci.ConfigureAgent())
}
func Build() {
must.RunV("go", "build", "./...")
}
func Vet() {
must.RunV("go", "vet", "./...")
}
// Run golangci-lint on the project
func Lint() {
mg.Deps(tools.EnsureGolangCILint)
must.RunV("golangci-lint", "run", "./...")
}
func Test() {
// Set up the bin with porter installed, tests can use that to initialize their local test bin to save time re-downloading it
mg.SerialDeps(porter.UseBinForPorterHome, porter.EnsurePorter)
must.RunV("go", "test", "./...")
}
// SetupDCO configures your git repository to automatically sign your commits
// to comply with our DCO
func SetupDCO() error {
return git.SetupDCO()
}