forked from canonical/iot-devicetwin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
56 lines (53 loc) · 1.75 KB
/
Taskfile.yml
File metadata and controls
56 lines (53 loc) · 1.75 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
version: '3'
dotenv: [ '{{.HOME}}/.device-management-env', '.env' ]
includes:
dev: "./taskfiles/k8s-dev.yml"
docs: "./taskfiles/docs.yml"
go: "./taskfiles/go.yml"
tasks:
precommit:
cmds:
- task: gofmt
- task: goimports
- task: lint
- task: test
- task: test-race
- task: build
- task: generate-docs
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 {} \;
build:
desc: Build the devicetwin server
vars:
GIT_SUMMARY:
sh: git describe --tags --dirty --always
cmds:
- go build -o devicetwin -ldflags='-X github.com/everactive/iot-devicetwin/version.Version={{.GIT_SUMMARY}}' bin/devicetwin/devicetwin.go
generate-message-structs:
desc: This will generate the Go structs from the schema definitions
cmds:
- mkdir -p pkg/messages
- schema-generate -o pkg/messages/messages.go -p messages ./schemas/schemas.json
- schema-generate -o pkg/messages/rest.go -p messages ./schemas/rest_schemas.json
lint:
desc: Run the golangci-lint on the repo
cmds:
- golangci-lint run
test:
desc: Run the short tests for the whole repo
cmds:
- go test -short $(go list ./... | grep -v vendor) -count 1
test-race:
desc: Run race detection tests
cmds:
- go test ./... -race
generate-docs:
desc: Generate documentation from terraform-docs
cmds:
- terraform-docs markdown table --output-file ./README.md ./deploy/