-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
46 lines (41 loc) · 952 Bytes
/
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
# # # # # # # # # # # # # #
# Task Runner
# # # # # # # # # # # # # #
# github.com/go-task/task
version:
silent: true
cmds:
- echo VERSION={{.GIT_COMMIT}}
compile:
desc: Compiles the server
silent: true
cmds:
- echo "compiling binary..."
- go build -ldflags "-X '{{.API_VERSION}}' -X '{{.API_BUILDTIME}}'" -o ./build/{{.API_MAIN_FILENAME}} ./{{.API_MAIN_FILENAME}}.go
- echo "binary compiled."
test_server:
desc: Runs the server
deps: [version]
silent: true
cmds:
- task: compile
- ./build/{{.API_MAIN_FILENAME}}
generates:
- ./build/{{.API_MAIN_FILENAME}}
env:
API_ENV: test
API_PORT: 3000
API_DB_NAME: dbname
API_DB_USER: dbuser
API_DB_PWD: dbpass
API_DB_HOST: dbhost
API_DB_PORT: 3001
code_lines:
desc: Breakdown of source lines of code
cmds:
- find . -name '*.go' | xargs wc -l
test:
desc: Runs the server tests
silent: true
cmds:
- go test test/*