-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTaskfile.yml
More file actions
70 lines (58 loc) · 1.42 KB
/
Taskfile.yml
File metadata and controls
70 lines (58 loc) · 1.42 KB
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
version: '3'
vars:
BINARY_NAME: mkp-server
BUILD_DIR: build
MAIN_PACKAGE: ./cmd/server
tasks:
default:
desc: Run tests and build the application
deps: [test, build]
build:
desc: Build the application
cmds:
- mkdir -p {{.BUILD_DIR}}
- go build -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.MAIN_PACKAGE}}
run:
desc: Run the application
deps: [build]
cmds:
- ./{{.BUILD_DIR}}/{{.BINARY_NAME}}
lint:
desc: Run linting tools
cmds:
- golangci-lint run --allow-parallel-runners ./...
- go vet ./...
lint-fix:
desc: Run linting tools, and apply fixes.
cmds:
- golangci-lint run --allow-parallel-runners --fix ./...
test:
desc: Run tests
cmds:
- go test -v ./...
clean:
desc: Clean the build directory
cmds:
- rm -rf {{.BUILD_DIR}}
fmt:
desc: Format the code
cmds:
- go fmt ./...
- golangci-lint run --allow-parallel-runners --fix
deps:
desc: Update dependencies
cmds:
- go mod tidy
install:
desc: Install dependencies
cmds:
- go mod download
run-with-kubeconfig:
desc: Build and run with specific kubeconfig
cmds:
- mkdir -p {{.BUILD_DIR}}
- go build -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.MAIN_PACKAGE}}
- ./{{.BUILD_DIR}}/{{.BINARY_NAME}} --kubeconfig={{.KUBECONFIG}}
vars:
KUBECONFIG:
sh: echo ${KUBECONFIG:-"~/.kube/config"}