-
Notifications
You must be signed in to change notification settings - Fork 3
/
magefile.go
90 lines (73 loc) · 1.61 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//go:build mage
package main
import (
"get.porter.sh/magefiles/git"
"get.porter.sh/magefiles/mixins"
"get.porter.sh/magefiles/porter"
"get.porter.sh/magefiles/tools"
"github.com/carolynvs/magex/shx"
)
const (
mixinName = "tofu"
mixinPackage = "get.porter.sh/mixin/tofu"
mixinBin = "bin/mixins/" + mixinName
)
var (
magefile = mixins.NewMagefile(mixinPackage, mixinName, mixinBin)
must = shx.CommandBuilder{StopOnError: true}
)
func ConfigureAgent() {
magefile.ConfigureAgent()
}
// Build the mixin
func Build() {
magefile.Build()
}
// Cross-compile the mixin before a release
func XBuildAll() {
magefile.XBuildAll()
}
// Run unit tests
func TestUnit() {
magefile.TestUnit()
}
func Test() {
magefile.Test()
Build()
TestIntegration()
}
// Publish the mixin to github
func Publish() {
magefile.Publish()
}
// TestPublish tries out publish locally, with your github forks
// Assumes that you forked and kept the repository name unchanged.
func TestPublish(username string) {
magefile.TestPublish(username)
}
// Install the mixin
func Install() {
magefile.Install()
}
// Remove generated build files
func Clean() {
magefile.Clean()
}
// Install porter locally
func EnsureLocalPorter() {
porter.UseBinForPorterHome()
porter.EnsurePorter()
}
func TestIntegration() {
EnsureLocalPorter()
must.Command("./scripts/test/test-cli.sh").RunV()
}
// SetupDCO configures your git repository to automatically sign your commits
// to comply with our DCO
func SetupDCO() error {
return git.SetupDCO()
}
// Ensure EnsureMage is installed and on the PATH.
func EnsureMage() error {
return tools.EnsureMage()
}