forked from canonical/iot-management
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
49 lines (46 loc) · 1.47 KB
/
Taskfile.yaml
File metadata and controls
49 lines (46 loc) · 1.47 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
version: '3'
dotenv: ['{{.HOME}}/.device-management-env', '.env']
includes:
dev: "./taskfiles/k8s-dev.yml"
tasks:
precommit:
cmds:
- task: gofmt
- task: goimports
- task: lint
- task: test
- task: test-race
- task: generate-docs
build:
desc: Build the binaries
vars:
GIT_SUMMARY:
sh: git describe --tags --dirty --always
cmds:
- CGO_ENABLED=1 GOOS=linux go build -a -o management -ldflags='-extldflags "-static" -X github.com/everactive/iot-management/versions.Version={{.GIT_SUMMARY}}' ./bin/management/management.go
- CGO_ENABLED=1 GOOS=linux go build -a -o createsuperuser -ldflags='-extldflags "-static" -X github.com/everactive/iot-management/versions.Version={{.GIT_SUMMARY}}' cmd/createsuperuser/main.go
gofmt:
desc: Runs gofmt on every file in the project directory
cmds:
- find . -name \*.go -exec gofmt -w {} \;
goimports:
desc: Runs goimports on every file in the project directory
cmds:
- find . -name \*.go -exec goimports -w {} \;
lint:
desc: Run the golangci-lint on the repo
cmds:
- golangci-lint run
test:
desc: Run tests for the gateway controller
cmds:
- go test ./...
test-race:
desc: Run race detection tests
cmds:
- go test ./... -race
generate-docs:
desc: Generate the docs using terraform-docs
cmds:
- terraform-docs markdown table --output-file ./README.md ./deploy/
- cd deploy && terraform fmt