This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathtypical-build.go
69 lines (65 loc) · 1.72 KB
/
typical-build.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
package main
import (
"github.com/typical-go/typical-go/pkg/typapp"
"github.com/typical-go/typical-go/pkg/typgen"
"github.com/typical-go/typical-go/pkg/typgo"
"github.com/typical-go/typical-go/pkg/typmock"
"github.com/typical-go/typical-go/pkg/typrls"
"github.com/typical-go/typical-rest-server/pkg/typcfg"
"github.com/typical-go/typical-rest-server/pkg/typdb"
"github.com/typical-go/typical-rest-server/pkg/typdocker"
"github.com/typical-go/typical-rest-server/pkg/typredis"
)
var descriptor = typgo.Descriptor{
ProjectName: "typical-rest-server",
ProjectVersion: "0.9.21",
Environment: typgo.DotEnv(".env"),
Tasks: []typgo.Tasker{
// generate
&typgen.Generator{
Processor: typgen.Processors{
&typapp.CtorAnnot{},
&typdb.DBRepoAnnot{},
&typcfg.EnvconfigAnnot{GenDotEnv: ".env", GenDoc: "USAGE.md"},
},
},
// test
&typgo.GoTest{
Includes: []string{"internal/app/**", "pkg/**"},
},
// compile
&typgo.GoBuild{},
// run
&typgo.RunBinary{
Before: typgo.TaskNames{"build"},
},
// mock
&typmock.GoMock{},
// docker
&typdocker.DockerTool{
ComposeFiles: typdocker.ComposeFiles("deploy"),
EnvFile: ".env",
},
// pg
&typdb.PostgresTool{Name: "pg"},
// cache
&typredis.RedisTool{Name: "cache"},
// setup
&typgo.Task{
Name: "setup",
Usage: "setup dependency",
Action: typgo.TaskNames{
"pg drop", "pg create", "pg migrate", "pg seed",
},
},
// release
&typrls.ReleaseProject{
Before: typgo.TaskNames{"test", "build"},
// Releaser: &typrls.CrossCompiler{Targets: []typrls.Target{"darwin/amd64", "linux/amd64"}},
Publisher: &typrls.Github{Owner: "typical-go", Repo: "typical-rest-server"},
},
},
}
func main() {
typgo.Start(&descriptor)
}