-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.yaml
128 lines (112 loc) · 3.16 KB
/
build.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
env:
# the application version
APP_VERSION: 1.0.0
# a unique build number
BUILD_VERSION: ${APP_VERSION}-${ARTISAN_REF}
labels:
author: SouthWinds Tech Ltd
application: Pilot Host Controller
description: Agent for managing remote host configuration
architecture: AMD64
functions:
- name: build-linux
description: builds the host pilot binary for the linux platform
env:
GOOS: linux
GOARCH: amd64
run:
- go build -trimpath -ldflags="-X 'southwinds.dev/piloth/core.Version=${BUILD_VERSION}'" -o bin/linux/pilot -v
- name: build-windows
description: builds the host pilot binary for the windows platform
env:
GOOS: windows
GOARCH: amd64
run:
- go build -trimpath -ldflags="-X 'southwinds.dev/piloth/core.Version=${BUILD_VERSION}'" -o bin/windows/pilot -v
- name: build-mac
description: builds the host pilot binary for the macos platform
env:
GOOS: darwin
GOARCH: amd64
run:
- go build -trimpath -ldflags="-X 'southwinds.dev/piloth/core.Version=${BUILD_VERSION}'" -o bin/darwin/pilot -v
- name: build-arm
description: builds the host pilot binary for the linux platform
env:
GOOS: linux
GOARCH: arm
GOARM: 5
run:
- go build -ldflags="-X 'southwinds.dev/piloth/core.Version=${BUILD_VERSION}'" -o bin/arm/pilot -v
- name: build-with-profiling
description: builds the host pilot binary for the specified platform with the specified profile tag
run:
- go build -tags ${PROFILE_TAG} -ldflags="-X 'southwinds.dev/piloth/core.Version=${BUILD_VERSION}-${PROFILE_TAG}'" -o ${BIN_PATH} -v
- name: build-linux-cpu
description: builds pilot for linux with CPU profiling
env:
BIN_PATH: bin/linux/pilot
PROFILE_TAG: cpu
GOOS: linux
run:
- $(build-with-profiling)
- name: build-mem-linux
description: builds pilot for linux with MEMORY profiling
env:
BIN_PATH: bin/linux/pilot
PROFILE_TAG: mem
GOOS: linux
run:
- $(build-with-profiling)
- name: build-cpu-darwin
env:
BIN_PATH: bin/darwin/pilot
PROFILE_TAG: cpu
GOOS: darwin
run:
- $(build-with-profiling)
- name: build-mem-darwin
env:
BIN_PATH: bin/darwin/pilot
PROFILE_TAG: mem
GOOS: darwin
run:
- $(build-with-profiling)
- name: analyse
run:
- go tool pprof --pdf ${BIN_PATH} ${PPROF_PATH} > ${PROFILE_TAG}.pdf
- name: analyse-cpu-linux
env:
BIN_PATH: bin/linux/pilot
PROFILE_TAG: cpu
run:
- go tool pprof --pdf ${BIN_PATH} ${PPROF_PATH} > ${PROFILE_TAG}.pdf
- name: analyse-mem-linux
env:
BIN_PATH: bin/linux/pilot
PROFILE_TAG: mem
run:
- go tool pprof --pdf ${BIN_PATH} ${PPROF_PATH} > ${PROFILE_TAG}.pdf
profiles:
- name: linux
default: true
type: content/binary
license: AGPL 3
run:
- $(build-linux)
target: bin/linux
- name: mac
default: true
type: content/binary
license: AGPL 3
run:
- $(build-mac)
target: bin/darwin
- name: windows
type: content/binary
license: AGPL 3
run:
- $(build-windows)
target: bin/windows
...