Skip to content

Commit

Permalink
add goreleaser setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtanda committed Jul 27, 2020
1 parent 6c5b635 commit f28f645
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
builds:
- main: ./
flags: -a -tags netgo
ldflags: |
-s -w
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
nfpms:
-
package_name: rds-enhanced-monitoring-exporter
file_name_template: 'rds-enhanced-monitoring-exporter_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
homepage: https://github.com/mtanda/rds_enhanced_monitoring_exporter
maintainer: Mitsuhiro Tanda
description: RDS Enhanced Monitoring Exporter for Prometheus
license: Apache 2.0
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
formats:
- deb
- rpm
files:
"packaging/deb/systemd/**": "/usr/lib/systemd/system"
config_files:
"packaging/deb/etc/default/rds_enhanced_monitoring_exporter": "/etc/default/rds_enhanced_monitoring_exporter"
"packaging/deb/usr/local/etc/rds_enhanced_monitoring_exporter.yml": "/usr/local/etc/rds_enhanced_monitoring_exporter.yml"
scripts:
postinstall: "packaging/scripts/postinstall.sh"
postremove: "packaging/scripts/postremove.sh"
preremove: "packaging/scripts/preremove.sh"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^cut:'
- '^typo'
1 change: 1 addition & 0 deletions packaging/deb/etc/default/rds_enhanced_monitoring_exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARGS="--config.file=/usr/local/etc/rds_enhanced_monitoring_exporter.yml"
14 changes: 14 additions & 0 deletions packaging/deb/systemd/rds-enhanced-monitoring-exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=RDS Enhanced Monitoring Exporter for Prometheus
After=network.target

[Service]
User=nobody
Group=nogroup
Type=simple
Restart=always
EnvironmentFile=/etc/default/rds_enhanced_monitoring_exporter
ExecStart=/usr/local/bin/rds_enhanced_monitoring_exporter $ARGS

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
targets:
3 changes: 3 additions & 0 deletions packaging/scripts/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
systemctl daemon-reload
systemctl enable rds-enhanced-monitoring-exporter.service
systemctl restart rds-enhanced-monitoring-exporter.service
1 change: 1 addition & 0 deletions packaging/scripts/postremove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
systemctl daemon-reload
2 changes: 2 additions & 0 deletions packaging/scripts/preremove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
systemctl stop rds-enhanced-monitoring-exporter.service
systemctl disable rds-enhanced-monitoring-exporter.service

0 comments on commit f28f645

Please sign in to comment.