-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
56 lines (46 loc) · 1.1 KB
/
Taskfile.yml
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
# https://taskfile.dev
version: '3'
vars:
OUT_DIR: "{{ env \"OUT_DIR\" | default \"dist\" }}"
OUT_FILE: "{{ env \"OUT_FILE\" | default \"jctp\" }}"
tasks:
build:
internal: true
aliases:
- build
- compile
vars:
BUILD_VERSION: "{{ env \"BUILD_VERSION\" | default \"dev\" }}"
BUILD_COMMIT:
sh: echo "${BUILD_COMMIT:-$(git rev-parse --short HEAD)}"
cmd: |
go build \
-ldflags="{{.LDFLAGS}} -X 'main.Version={{.BUILD_VERSION}}' -X 'main.CommitHash={{.BUILD_COMMIT}}' -X 'main.BuildTimestamp={{ now }}'" \
-o "{{.OUT_DIR}}/{{.OUT_FILE}}" \
.
deps:
- clean
dev:
cmd: wgo run .
default:
cmds:
- task: dev
build:release:
cmds:
- task: build
vars:
LDFLAGS: -s -w
build:debug:
cmds:
- task: build
vars:
LDFLAGS: ""
clean:
cmd: rm -rf "{{.OUT_DIR}}"
test:
cmd: go test -v -cover -coverprofile=coverage.out ./...
docker:
cmds:
- task: build:debug
- docker build . -t jctp
# - docker run --rm -it --name jctp -p 1337:1337 jctp