-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTaskfile.yml
102 lines (78 loc) · 2.01 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '3'
################################################################################################
#
# ref:
# - https://taskfile.dev/#/usage
#
################################################################################################
#
# global vars: https://taskfile.dev/#/usage?id=variables
#
vars:
VAR1: "some-var"
#
# global env: https://taskfile.dev/#/usage?id=environment-variables
#
env:
ENV1: testing-env
# env file:
dotenv:
- .env
################################################################################################
#
# task groups: https://taskfile.dev/#/usage?id=task-directory
#
tasks:
default:
cmds:
- task: init
- task: tidy
- task: run
install:
cmds:
- brew install go
- go install github.com/oligot/go-mod-upgrade
init:
cmds:
- cp .env.local .env
clean:
cmds:
- go clean --modcache
download:
cmds:
- go mod download
tidy:
cmds:
- go mod tidy -v
- cd time; go mod tidy -v
- cd log; go mod tidy -v
- cd errors; go mod tidy -v
- cd cache; go mod tidy -v
- cd os; go mod tidy -v
- cd x/gin; go mod tidy -v
- cd x/go-zero; go mod tidy -v
- cd x/go-micro; go mod tidy -v
- cd database; go mod tidy -v
################################################################################################
upgrade:all:
cmds:
- export GOPROXY=https://goproxy.cn; go-mod-upgrade
upgrade:one:
cmds:
- export GOPROXY=https://goproxy.cn; go get -u -v ${GO_PKG_NAME}
- task: tidy
dep-check:
cmds:
- go mod graph
test:
cmds:
- go test all
################################################################################################
pull:
cmds:
- git config pull.rebase false
- git pull
push:
cmds:
- git push origin master --tags
- repo_url=`git remote -v | grep push | awk -F ":" '{print $2}' | awk -F ".git" '{print "https://github.com/"$1}'`; open $repo_url