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 27
/
typical-build.go
95 lines (82 loc) · 2.11 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package main
import (
"github.com/typical-go/typical-go/pkg/typannot"
"github.com/typical-go/typical-go/pkg/typapp"
"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/dockerrx"
"github.com/typical-go/typical-rest-server/pkg/typdocker"
"github.com/typical-go/typical-rest-server/pkg/typrest"
pg "github.com/typical-go/typical-rest-server/tools/pg-tool/pkg/util"
)
var descriptor = typgo.Descriptor{
ProjectName: "typical-rest-server",
ProjectVersion: "0.8.36",
ProjectLayouts: []string{"internal", "pkg"},
Cmds: []typgo.Cmd{
// test
&typgo.TestCmd{
Action: &typgo.StdTest{},
},
&typannot.AnnotateCmd{
Annotators: []typannot.Annotator{
&typapp.CtorAnnotation{},
&typapp.DtorAnnotation{},
&typrest.AppCfgAnnotation{DotEnv: true},
},
},
// compile
&typgo.CompileCmd{
Action: &typgo.StdCompile{},
},
// run
&typgo.RunCmd{
Before: typgo.BuildSysRuns{"annotate", "compile"},
Action: &typgo.StdRun{},
},
// clean
&typgo.CleanCmd{
Action: &typgo.StdClean{},
},
// mock
&typmock.MockCmd{},
// docker
&typdocker.DockerCmd{
Composers: []typdocker.Composer{
&dockerrx.PostgresWithEnv{
Name: "pg01",
UserEnv: "PG_USER",
PasswordEnv: "PG_PASSWORD",
PortEnv: "PG_PORT",
},
&dockerrx.RedisWithEnv{
Name: "redis01",
PasswordEnv: "REDIS_PASSWORD",
PortEnv: "REDIS_PORT",
},
},
},
// pg
&pg.PSQLCmd{
Name: "pg",
HostEnv: "PG_HOST",
PortEnv: "PG_PORT",
UserEnv: "PG_USER",
PasswordEnv: "PG_PASSWORD",
DBNameEnv: "PG_DBNAME",
MigrationSrc: "databases/pg/migration",
SeedSrc: "databases/pg/seed",
},
// release
&typrls.ReleaseCmd{
Before: typgo.BuildSysRuns{"test", "compile"},
Validation: typrls.DefaultValidation,
Summary: typrls.DefaultSummary,
Releaser: &typrls.Github{Owner: "typical-go", Repo: "typical-rest-server"},
},
},
}
func main() {
typgo.Start(&descriptor)
}