-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagefile.go
54 lines (44 loc) · 1.06 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
//+build mage
package main
import (
"github.com/magefile/mage/sh"
)
const manifestFile = "docker-manifest.yaml"
func Build() error {
return sh.RunV("go", "build", "-o", "vpresent")
}
const pkg = "github.com/gernest/vectypresent"
func Ui() error {
return sh.RunV("gopherjs", "build", "-m", "-o", "static/ui.js", pkg+"/ui")
}
func Serve() error {
if err := Ui(); err != nil {
return err
}
if err := AssetsDev(); err != nil {
return err
}
if err := Build(); err != nil {
return err
}
return sh.RunV("./vpresent", "serve", "talks/")
}
func Release() error {
return sh.RunV("goreleaser", "--rm-dist")
}
func Manifest() error {
return sh.RunV("manifest-tool",
"--username", "$DOCKERHUB_USER",
"--password", "$DOCKERHUB_PASSWORD",
"push", "from-spec", manifestFile)
}
func Assets() error {
return sh.RunV("go-bindata", "-o", "data/assets.gen.go",
"-pkg", "data", "-prefix", "static/", "static/...",
)
}
func AssetsDev() error {
return sh.RunV("go-bindata", "-debug", "-o", "data/assets.gen.go",
"-pkg", "data", "-prefix", "static/", "static/...",
)
}