-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathABTaskFile
95 lines (82 loc) · 2.51 KB
/
ABTaskFile
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
name: build_tasks
description: Choria Build Tasks
commands:
- name: dependencies
type: parent
description: Manage dependencies
aliases: [d]
commands:
- name: update
description: Update dependencies
type: exec
aliases: [up]
dir: "{{ AppDir }}"
flags:
- name: verbose
description: Log verbosely
short: v
bool: true
- name: proxy
description: Enable using go proxy
bool: true
default: "true"
script: |
. "{{ BashHelperPath }}"
ab_announce Updating all dependencies
echo
{{ if eq .Flags.proxy false }}
export GOPROXY=direct
ab_say Disabling go mod proxy
{{ end }}
go get -u -n -a -t {{- if .Flags.verbose }} -d -x {{ end }} ./...
ab_say Running go mod tidy
go mod tidy
- name: build
type: parent
aliases: [b]
description: Code build steps
commands:
- name: binary
description: Build a basic test binary
type: exec
dir: "{{ AppDir }}"
aliases: [bin]
banner: |
>>>
>>> Building 'tally' locally
>>>
>>> Target: {{ if .Flags.target }}{{ .Flags.target }}{{else}}host{{end}}
>>>
flags:
- name: target
description: Target platform to build for
enum: ["linux/amd64", "linux/arm64"]
short: T
- name: verbose
description: Logs packages being build
bool: true
short: v
script: |
set -e
. "{{ BashHelperPath }}"
{{ if eq .Flags.target "linux/amd64" }}
export GOOS=linux
export GOARCH=amd64
{{ else if eq .Flags.target "linux/arm64" }}
export GOOS=linux
export GOARCH=arm64
{{ end }}
{{ if .Flags.verbose }}
ab_say Packages being build
{{ end }}
go build \
{{ if .Flags.verbose }}-v{{ end }} \
-ldflags="-s -w \
-X 'github.com/choria-io/tally.version=0.98.0.$(date +%s)' \
" -o tally
ab_say Build completed
echo
ls -l tally
echo
file tally
echo