-
Notifications
You must be signed in to change notification settings - Fork 4
/
development.flow
203 lines (190 loc) · 5.11 KB
/
development.flow
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
visibility: private
tags: [development]
executables:
- verb: run
name: checks
aliases: [precommit, pc, ci, validate]
description: |
Run the repository validation checks. This includes linting, tests, and code generation.
Validate should be run before committing changes.
parallel:
failFast: true
maxThreads: 2
execs:
- ref: generate code
- ref: generate docs
- ref: run linters
- ref: run tests
- verb: build
name: binary
aliases: [bin, flow]
description: |
Build the flow binary. The binary is built at the path specified in the first positional argument.
If not set, the binary is built at .bin/flow.
exec:
dir: //
args:
- envKey: BIN_PATH
default: .bin
pos: 1
required: false
params:
- envKey: BIN_NAME
text: flow
cmd: |
go build -o ${BIN_PATH}/${BIN_NAME}
echo "flow built at ${BIN_PATH}/${BIN_NAME}"
- verb: generate
name: docs
aliases: [documentation]
exec:
dir: //
cmd: |
echo "generating completions..."
./scripts/completions.sh
go run ./tools/docsgen/.
- verb: generate
name: code
exec:
dir: //
cmd: echo "generating code..."; go generate ./...
- verb: run
name: linters
aliases: [formatters]
description: Run linters and formatters
exec:
dir: //
cmd: |
go fmt ./...
go mod tidy
golangci-lint run ./... --fix
- verb: run
name: tests
aliases: [test, unit, e2e]
description: Run all project tests
exec:
dir: //
cmd: go test ./... -race
- verb: install
name: gopath
aliases: [local]
description: Install the project to the GOPATH from local source
exec:
dir: //
cmd: go install ./...
- verb: install
name: deps
description: Install project dependencies using go
tags: [go, development]
aliases: [tools, go-tools, go-deps]
exec:
dir: //
cmd: |
echo "installing cobra-cli..."
go install github.com/spf13/[email protected]
echo "installing golangci-lint..."
go install github.com/golangci/golangci-lint/cmd/[email protected]
echo "installing ginkgo..."
go install github.com/onsi/ginkgo/v2/[email protected]
echo "installing goreleaser..."
go install github.com/goreleaser/[email protected]
- verb: update
name: modules
description: Update project dependencies
tags: [go, development]
aliases: [gomod, go-mod, deps, go-deps]
exec:
dir: //
cmd: |
echo "updating go modules..."
go get -u ./...
go mod tidy
- verb: build
name: container
description: Build the flow container image
tags: [docker, development]
aliases: [docker, image]
exec:
dir: //
args:
- envKey: BUILDER
default: docker
flag: builder
- envKey: IMAGE_REPO
default: jahvon/flow
flag: repo
- envKey: IMAGE_TAG
default: latest
flag: tag
cmd: |
echo "building go binary..."
GOOS=linux GOARCH=amd64 go build -o flow
echo "building container image..."
$BUILDER build -t $IMAGE_REPO:$IMAGE_TAG .
- verb: run
name: container
description: Run the flow container image
tags: [docker, development]
aliases: [image, docker]
exec:
dir: //
logMode: text
args:
- envKey: BUILDER
default: docker
flag: builder
- envKey: IMAGE_REPO
default: jahvon/flow
flag: repo
- envKey: IMAGE_TAG
default: latest
flag: tag
- envKey: WORKSPACE
default: active
flag: workspace
- envKey: GIT_REPO
default: https://github.com/jahvon/flow.git
flag: repo
- envKey: BRANCH
default: main
flag: branch
- envKey: CONTAINER_CMD
default: "get workspace"
flag: cmd
cmd: |
echo "running container image..."
$BUILDER run -it -e GIT_REPO=$GIT_REPO \
-e BRANCH=$BRANCH \
-e WORKSPACE=$WORKSPACE \
-t $IMAGE_REPO:$IMAGE_TAG \
$CONTAINER_CMD
- verb: push
name: container
description: Push the flow container image to the registry
tags: [docker, development]
aliases: [image, docker]
exec:
dir: //
args:
- envKey: BUILDER
default: docker
flag: builder
- envKey: IMAGE_REPO
default: jahvon/flow
flag: repo
- envKey: IMAGE_TAG
default: latest
flag: tag
cmd: |
echo "pushing container image..."
$BUILDER push $IMAGE_REPO:$IMAGE_TAG
- verb: create
name: snapshot
description: Create a snapshot release
aliases: [release, snap]
exec:
dir: //
cmd: |
echo "creating snapshot release..."
goreleaser release --snapshot --clean