-
Notifications
You must be signed in to change notification settings - Fork 17
/
magefile.go
76 lines (61 loc) · 1.88 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
//go:build mage
package main
import (
"os"
"get.porter.sh/magefiles/mixins"
"get.porter.sh/magefiles/releases"
)
const (
mixinName = "skeletor"
mixinPackage = "github.com/getporter/skeletor"
mixinBin = "bin/mixins/" + mixinName
)
var magefile = mixins.NewMagefile(mixinPackage, mixinName, mixinBin)
// ConfigureAgent sets up the CI server with mage and GO
func ConfigureAgent() {
magefile.ConfigureAgent()
}
// Build the mixin
func Build() {
magefile.Build()
}
// XBuildAll cross-compiles the mixin before a release
func XBuildAll() {
magefile.XBuildAll()
}
// TestUnit runs the unit tests
func TestUnit() {
magefile.TestUnit()
}
// Test runs all types of tests
func Test() {
magefile.Test()
}
// Publish the mixin to GitHub
func Publish() {
// You can test out publishing locally by overriding PORTER_RELEASE_REPOSITORY and PORTER_PACKAGES_REMOTE
if _, overridden := os.LookupEnv(releases.ReleaseRepository); !overridden {
os.Setenv(releases.ReleaseRepository, "github.com/YOURNAME/YOURREPO")
}
magefile.PublishBinaries()
// TODO: uncomment out the lines below to publish a mixin feed
// Set PORTER_PACKAGES_REMOTE to a repository that will contain your mixin feed, similar to github.com/getporter/packages
//if _, overridden := os.LookupEnv(releases.PackagesRemote); !overridden {
// os.Setenv("PORTER_PACKAGES_REMOTE", "[email protected]:YOURNAME/YOUR_PACKAGES_REPOSITORY")
//}
//magefile.PublishMixinFeed()
}
// TestPublish publishes the project to the specified GitHub username.
// If your mixin is official hosted in a repository under your username, you will need to manually
// override PORTER_RELEASE_REPOSITORY and PORTER_PACKAGES_REMOTE to test out publishing safely.
func TestPublish(username string) {
magefile.TestPublish(username)
}
// Install the mixin
func Install() {
magefile.Install()
}
// Clean removes generated build files
func Clean() {
magefile.Clean()
}