-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
80 lines (67 loc) · 1.51 KB
/
Taskfile.yml
File metadata and controls
80 lines (67 loc) · 1.51 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
71
72
73
74
75
76
77
78
79
80
version: '3'
vars:
BINARY_NAME: gofetch
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 ./...
- go vet ./...
lint-fix:
desc: Run linting tools, and apply fixes.
cmds:
- golangci-lint run --fix ./...
test:
desc: Run tests
cmds:
- go test -v ./...
test-integration:
desc: Run integration tests
cmds:
- ./test/integration-test.sh
- ./test/integration-endpoints.sh
clean:
desc: Clean the build directory
cmds:
- rm -rf {{.BUILD_DIR}}
fmt:
desc: Format the code
cmds:
- go fmt ./...
- golangci-lint run --fix
deps:
desc: Update dependencies
cmds:
- go mod tidy
install:
desc: Install dependencies
cmds:
- go mod download
build-image:
desc: Build the image locally with ko
env:
KO_DOCKER_REPO: ghcr.io/stackloklabs/gofetch/server
VERSION: dev-local
cmds:
- |
if [[ $(uname -m) == "arm64" ]]; then
PLATFORM="linux/arm64"
else
PLATFORM="linux/amd64"
fi
ko build ./cmd/server --bare --local --platform=$PLATFORM