-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTaskfile.yml
More file actions
61 lines (51 loc) · 1.49 KB
/
Copy pathTaskfile.yml
File metadata and controls
61 lines (51 loc) · 1.49 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
# https://taskfile.dev
version: "3"
vars:
BINNAME: uplift
GIT_COMMIT:
sh: git rev-parse HEAD
GIT_SHA:
sh: git rev-parse --short HEAD
GIT_BRANCH:
sh: git branch --show-current
LDFLAGS: >
-X github.com/gembaadvantage/uplift/internal/version.version=dev-{{.GIT_SHA}}
-X github.com/gembaadvantage/uplift/internal/version.gitCommit={{.GIT_COMMIT}}
-X github.com/gembaadvantage/uplift/internal/version.gitBranch={{.GIT_BRANCH}}
-X github.com/gembaadvantage/uplift/internal/version.buildDate={{now | date "2006-01-02T15:04:05Z07:00"}}
tasks:
default:
desc: Runs all of the default tasks
cmds:
- task: lint
- task: docker-lint
- task: test
- task: build
build:
desc: Build the uplift binary
cmds:
- CGO_ENABLED=0 go build -ldflags '-s -w {{.LDFLAGS}}' -o '{{.BINNAME}}' ./cmd/uplift
test:
desc: Run the tests
cmds:
- go test -race -vet=off -p 1 -covermode=atomic -coverprofile=coverage.out ./...
lint:
desc: Lint the code using golangci
cmds:
- golangci-lint run --timeout 5m0s
docker-lint:
desc: Lint the Dockerfile using Hadolint
cmds:
- hadolint Dockerfile
format:
desc: Format all code using gofumpt
cmds:
- gofumpt -w -l .
clean:
desc: Delete all artefacts from recent build
cmds:
- rm -f ./{{.BINNAME}}
docs:
desc: Builds and hosts the MkDocs documentation
cmds:
- docker run --rm -it -p 8000:8000 -v $PWD:/docs squidfunk/mkdocs-material