Files
unpoller_unpoller/.goreleaser.yaml
T

455 lines
13 KiB
YAML

# .goreleaser.yaml
version: 2
before:
hooks:
- make man
- make readme
- make rsrc
builds:
- id: unpoller
env:
- CGO_ENABLED=0
binary: unpoller
goos:
- linux
goarch:
- amd64
- "386"
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X "golift.io/version.Version={{.Version}}" -X "golift.io/version.Branch={{.Branch}} ({{.Commit}})" -X "golift.io/version.BuildDate={{.Date}}" -X "golift.io/version.BuildUser=goreleaser" -X "golift.io/version.Revision=1"
ignore:
- goamd64: v4
- id: unpoller-freebsd
env:
- CGO_ENABLED=0
binary: /usr/local/bin/unpoller
goos:
- freebsd
goarch:
- amd64
- arm64
- arm
goarm:
- "7"
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X "golift.io/version.Version={{.Version}}" -X "golift.io/version.Branch={{.Branch}} ({{.Commit}})" -X "golift.io/version.BuildDate={{.Date}}" -X "golift.io/version.BuildUser=goreleaser" -X "golift.io/version.Revision=1"
ignore:
- goamd64: v4
- id: unpoller-mac
env:
- CGO_ENABLED=0
binary: unpoller
goos:
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X "golift.io/version.Version={{.Version}}" -X "golift.io/version.Branch={{.Branch}} ({{.Commit}})" -X "golift.io/version.BuildDate={{.Date}}" -X "golift.io/version.BuildUser=goreleaser" -X "golift.io/version.Revision=1"
ignore:
- goos: darwin
goarch: "386"
- id: unpoller-linux-arm
env:
- CGO_ENABLED=0
binary: unpoller
goarm:
- "6"
- "7"
goos:
- linux
goarch:
- arm64
- arm
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X "golift.io/version.Version={{.Version}}" -X "golift.io/version.Branch={{.Branch}} ({{.Commit}})" -X "golift.io/version.BuildDate={{.Date}}" -X "golift.io/version.BuildUser=goreleaser" -X "golift.io/version.Revision=1"
- id: unpoller-windows
env:
- CGO_ENABLED=0
binary: unpoller
goos:
- windows
goarch:
- amd64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X "golift.io/version.Version={{.Version}}" -X "golift.io/version.Branch={{.Branch}} ({{.Commit}})" -X "golift.io/version.BuildDate={{.Date}}" -X "golift.io/version.BuildUser=goreleaser" -X "golift.io/version.Revision=1"
hooks:
post:
- cmd: bash init/windows/signexe.sh "{{ .Path }}"
if: '{{ eq .Os "windows" }}'
universal_binaries:
- id: unpoller-mac
ids: [unpoller-mac]
replace: true
# Sign + notarize the macOS universal binary (quill; works on Linux CI).
# Enabled only when MACOS_SIGN_P12 is set so local snapshots still work.
notarize:
macos:
- enabled: '{{ isEnvSet "MACOS_SIGN_P12" }}'
ids:
- unpoller-mac
sign:
certificate: "{{ .Env.MACOS_SIGN_P12 }}"
password: "{{ .Env.MACOS_SIGN_PASSWORD }}"
notarize:
issuer_id: "{{ .Env.MACOS_NOTARY_ISSUER_ID }}"
key_id: "{{ .Env.MACOS_NOTARY_KEY_ID }}"
key: "{{ .Env.MACOS_NOTARY_KEY }}"
wait: true
timeout: 20m
archives:
- id: unpoller
ids:
- unpoller
files:
- LICENSE
- README.md
- examples/up.*.example
- id: unpoller-linux-arm
ids:
- unpoller-linux-arm
files:
- LICENSE
- README.html
- unpoller_manual.html
- examples/up.*.example
- id: unpoller-mac
ids:
- unpoller-mac
files:
- LICENSE
- README.html
- unpoller_manual.html
- examples/up.*.example
- id: unpoller-windows
format_overrides:
- goos: windows
formats:
- zip
ids:
- unpoller-windows
files:
- LICENSE
- README.html
- unpoller_manual.html
- rsrc_windows_*.syso
- examples/up.*.example
- init/windows/application.ico
- id: unpoller-freebsd-pkg
ids:
- unpoller-freebsd
formats:
- tar.xz
wrap_in_directory: false
files:
# config files
- src: "examples/up.conf.example"
dst: "/usr/local/etc/unpoller"
strip_parent: true
- src: "examples/up.json.example"
dst: "/usr/local/etc/unpoller"
strip_parent: true
- src: "examples/up.yaml.example"
dst: "/usr/local/etc/unpoller"
strip_parent: true
# docs
- src: "README.html"
dst: "/usr/local/share/doc/unpoller/"
strip_parent: true
- src: "unpoller_manual.html"
dst: "/usr/local/share/doc/unpoller/"
strip_parent: true
- src: LICENSE
dst: "/usr/local/share/doc/unpoller/"
strip_parent: true
- src: "unpoller.1.gz"
dst: /usr/local/share/man/man1
strip_parent: true
- src: "init/bsd/unpoller"
dst: /usr/local/etc/rc.d
strip_parent: true
info:
mode: 0755
dockers_v2:
- id: unpoller-multiarch
dockerfile: Dockerfile
ids:
- unpoller
- unpoller-linux-arm
images:
- ghcr.io/unpoller/unpoller
- docker.io/golift/unifi-poller
tags:
- "latest"
- "{{ .Tag }}"
- "v{{ .Major }}"
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
extra_files:
- examples/up.conf.example
- examples/up.json.example
- examples/up.yaml.example
- README.html
- unpoller_manual.html
labels:
org.opencontainers.image.created: "{{ .Date }}"
org.opencontainers.image.title: "{{ .ProjectName }}"
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: "{{ .Version }}"
org.opencontainers.image.documentation: "https://unpoller.com/docs/install/docker"
org.opencontainers.image.description: "Telemetry and Observability for your UniFi Network"
org.opencontainers.image.url: "https://unpoller.com"
org.opencontainers.image.source: "{{ .GitURL }}"
org.opencontainers.image.vendor: "unpoller"
org.opencontainers.image.licenses: "MIT"
nfpms:
- id: unpoller-packages
ids:
- unpoller
- unpoller-linux-arm
file_name_template: '{{ .ProjectName }}_{{ if eq .Os "darwin" }}macOS{{ else if eq .Os "linux" }}Tux{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "386" }}32-bit{{ else if eq .Arch "amd64" }}64-bit{{ else }}{{ .Arch }}{{ end }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
vendor: unpoller
homepage: https://unpoller.com/
maintainer: unpoller.com
description: Telemetry and Observability for your UniFi Network
license: MIT
formats:
- deb
- rpm
bindir: /usr/bin
version_metadata: git
section: default
priority: extra
# provides defines the packages. The first one defines the package name.
provides:
- unpoller
- unifi-poller
# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
- dst: /etc/unpoller
type: dir
file_info:
mode: 0755
- dst: /usr/share/doc/unpoller
type: dir
file_info:
mode: 0755
# Example config files
- src: examples/up.conf.example
dst: /etc/unpoller/up.conf.example
type: config
file_info:
mode: 0640
owner: unpoller
group: unpoller
- src: examples/up.json.example
dst: /etc/unpoller/up.json.example
type: config
file_info:
mode: 0640
owner: unpoller
group: unpoller
- src: examples/up.yaml.example
dst: /etc/unpoller/up.yaml.example
type: config
file_info:
mode: 0640
owner: unpoller
group: unpoller
# copy example by default to real locations, people can override, cnfg uses this.
- src: examples/up.conf.example
dst: /etc/unpoller/up.conf
type: config|noreplace
file_info:
mode: 0640
owner: unpoller
group: unpoller
# common useful info
- src: "README.html"
dst: /etc/unpoller/readme.html
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: "unpoller_manual.html"
dst: /etc/unpoller/manual.html
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
# man pages
- src: unpoller.1.gz
dst: /usr/share/man/man1/unpoller.1.gz
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: LICENSE
dst: /usr/share/doc/unpoller/LICENSE
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: unpoller_manual.html
dst: /usr/share/doc/unpoller/unpoller_manual.html
file_info:
mode: 0644
owner: unpoller
group: unpoller
# systemd service
- src: init/systemd/unpoller.service
dst: /etc/systemd/system/unpoller.service
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
# freebsd rc service
- src: init/bsd/unpoller
dst: /usr/local/etc/rc.d/unpoller
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
# web server statics
- dst: /usr/local/lib/unpoller/web/static/
type: dir
file_info:
mode: 0755
owner: unpoller
group: unpoller
- dst: /usr/local/lib/unpoller/web/static/css
type: dir
file_info:
mode: 0755
owner: unpoller
group: unpoller
- dst: /usr/local/lib/unpoller/web/static/images
type: dir
file_info:
mode: 0755
owner: unpoller
group: unpoller
- dst: /usr/local/lib/unpoller/web/static/js
type: dir
file_info:
mode: 0755
owner: unpoller
group: unpoller
- src: init/webserver/index.html
dst: /usr/local/lib/unpoller/web/static/index.html
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: init/webserver/static/css/*
dst: /usr/local/lib/unpoller/web/static/css
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: init/webserver/static/images/*
dst: /usr/local/lib/unpoller/web/static/images
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
- src: init/webserver/static/js/*
dst: /usr/local/lib/unpoller/web/static/js
type: config
file_info:
mode: 0644
owner: unpoller
group: unpoller
# signing
rpm:
signature:
key_file: "{{ .Env.GPG_SIGNING_KEY }}"
deb:
signature:
key_file: "{{ .Env.GPG_SIGNING_KEY }}"
type: origin
scripts:
preinstall: "scripts/pre-install.sh"
postinstall: "scripts/post-install.sh"
preremove: "scripts/pre-remove.sh"
postremove: "scripts/post-remove.sh"
signs:
- id: default
artifacts: all
ids:
- unpoller
- unpoller-linux-arm
- unpoller-windows
- unpoller-mac
homebrew_casks:
- name: unpoller
ids:
- unpoller-mac
binaries:
- unpoller
repository:
owner: golift
name: homebrew-mugs
branch: main
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
commit_msg_template: "Brew cask update for {{ .ProjectName }} version {{ .Tag }}"
directory: Casks
# enable the line below only for testing locally
# skip_upload: true
homepage: https://unpoller.com/
description: "Polls a UniFi controller, exports metrics to InfluxDB, Prometheus and Datadog"
caveats: "Edit the config file at #{etc}/unpoller/up.conf then start unpoller with brew services start unpoller ~ log file: #{var}/log/unpoller.log The manual explains the config file options: man unpoller"
license: MIT
service: |
run ["#{opt_bin}/unpoller", "--config", "#{etc}/unpoller/up.conf"]
keep_alive true
log_path "#{var}/log/unpoller.log"
error_log_path "#{var}/log/unpoller.log"
url:
template: "https://github.com/unpoller/unpoller/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
hooks:
post:
install: |
(etc/"unpoller").mkpath
FileUtils.cp "#{staged_path}/examples/up.conf.example", "#{etc}/unpoller/up.conf.example"
FileUtils.cp "#{staged_path}/examples/up.conf.example", "#{etc}/unpoller/up.conf" unless File.exist?("#{etc}/unpoller/up.conf")
publishers:
- name: "packagecloud-publisher"
ids:
- unpoller-packages
cmd: "scripts/packagecloud_push.sh '{{ .Tag }}' '{{ .Env.PACKAGECLOUD_TOKEN }}' 'unpoller' '{{ .ArtifactPath }}' '{{ .Os }}'"