-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
152 lines (143 loc) · 4.29 KB
/
.goreleaser.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# somewhat inspired from https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.goreleaser.yaml
project_name: sn-collector-experimental
builds:
- id: otelcol-servicenow
goos:
- darwin
- linux
# Disabled for Windows as we handle that in in release-msi.yml
# - windows
goarch:
- amd64
- arm
- arm64
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: darwin
goarch: s390x
# Disabled for Windows as we handle that in release-msi.yml
# - goos: windows
# goarch: arm
# - goos: windows
# goarch: arm64
# - goos: windows
# goarch: s390x
dir: ./collector/otelcol-servicenow
binary: otelcol-servicenow
ldflags:
- -s
- -w
flags:
- -trimpath
env:
- CGO_ENABLED=0
dockers:
- goos: linux
goarch: amd64
dockerfile: collector/Dockerfile
image_templates:
- ghcr.io/lightstep/sn-collector/sn-collector-experimental:{{ .Version }}-amd64
- ghcr.io/lightstep/sn-collector/sn-collector-experimental:latest-amd64
extra_files:
- collector/config/otelcol-docker-hostmetrics.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
- goos: linux
goarch: arm64
dockerfile: collector/Dockerfile
image_templates:
- ghcr.io/lightstep/sn-collector/sn-collector-experimental:{{ .Version }}-arm64
- ghcr.io/lightstep/sn-collector/sn-collector-experimental:latest-arm64
extra_files:
- collector/config/otelcol-docker-hostmetrics.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
docker_manifests:
- name_template: "ghcr.io/lightstep/sn-collector/sn-collector-experimental:latest"
image_templates:
- "ghcr.io/lightstep/sn-collector/sn-collector-experimental:latest-amd64"
- "ghcr.io/lightstep/sn-collector/sn-collector-experimental:latest-arm64"
skip_push: false
archives:
- id: otelcol-servicenow
builds:
- otelcol-servicenow
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
files:
- src: LICENSE
- src: collector/service/sn-collector.service
dst: install
strip_parent: true
- src: collector/service/com.servicenow.collector.plist
dst: install
strip_parent: true
# bundle default config files in packages
- src: collector/config/*.yaml
dst: config
strip_parent: true
format_overrides:
- goos: windows
format: zip
nfpms:
- id: otelcol-servicenow
package_name: sn-collector
builds:
- otelcol-servicenow
vendor: ServiceNow, Inc.
homepage: https://servicenow.com/
maintainer: ServiceNow Engineering <[email protected]>
description: SerivceNow distribution of the OpenTelemetry Collector.
formats:
- deb
- rpm
bindir: /opt/sn-collector
scripts:
preinstall: ./collector/scripts/package/preinstall.sh
postinstall: ./collector/scripts/package/postinstall.sh
contents:
- dst: /opt/sn-collector
type: dir
file_info:
mode: 0755
owner: sn-collector
group: sn-collector
- src: collector/config/otelcol-linux-hostmetrics.yaml
dst: /opt/sn-collector/config.yaml
file_info:
mode: 0640
owner: sn-collector
group: sn-collector
- src: collector/service/sn-collector.service
dst: /usr/lib/systemd/system/sn-collector.service
type: config|noreplace
file_info:
mode: 0644
owner: root
group: root
# https://goreleaser.com/customization/sign/
# meant to be run from the GitHub Action release.yml
signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PWD }}"
args:
["sign-blob", "--key=cosign.key", "--output-signature=${signature}", "${artifact}", "--yes"]
artifacts: all
# https://goreleaser.com/customization/sbom/
# sboms:
# - artifacts: archive
# cmd: syft
checksum:
name_template: 'checksums.txt'
release:
draft: false
prerelease: "true"
extra_files:
- glob: "./collector/scripts/install/install-unix.sh"
- glob: "./collector/scripts/install/install-macos.sh"