-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build packages for releases #2
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,7 @@ | |
# Go workspace file | ||
go.work | ||
|
||
# Goreleaser dist output files | ||
dist/ | ||
|
||
agentstate |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Options for hareply | ||
|
||
HAREPLY_FILE='/etc/hareply/agentstate' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=hareply | ||
After=syslog.target network-online.target | ||
|
||
[Service] | ||
Environment="PIDFILE=/run/hareply.pid" | ||
EnvironmentFile=/etc/default/hareply | ||
ExecStart=/usr/sbin/hareply | ||
ExecReload=/bin/kill -s SIGUSR1 $MAINPID | ||
Type=simple | ||
PIDFile= | ||
GuessMainPID=1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not well versed in systemd unit files, but I'm curious: why set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked into it in more detail, my conclusion in the end is that PID files should no longer be required for most services, and rather |
||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
systemctl --system daemon-reload || true | ||
systemctl enable hareply || true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
systemctl --system daemon-reload || true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
systemctl stop hareply || true | ||
systemctl disable hareply || true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
project_name: hareply | ||
builds: | ||
- binary: hareply | ||
- | ||
id: hareply-build | ||
binary: hareply | ||
goos: | ||
- linux | ||
- darwin | ||
|
@@ -11,7 +13,10 @@ builds: | |
ldflags: | ||
- -s -w -X github.com/friendlycaptcha/hareply/buildinfo.version={{.Version}} -X github.com/friendlycaptcha/hareply/buildinfo.commit={{.Commit}} -X github.com/friendlycaptcha/hareply/buildinfo.commitDate={{.CommitDate}} | ||
archives: | ||
- id: hareply-archive | ||
- | ||
id: hareply-archive | ||
builds: | ||
- hareply-build | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- .Tag }}_ | ||
|
@@ -20,3 +25,60 @@ archives: | |
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- LICENSE | ||
- README.md | ||
nfpms: | ||
- | ||
id: hareply-package | ||
package_name: hareply | ||
builds: | ||
- hareply-build | ||
file_name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- .Tag }}_ | ||
{{- .Os }}_ | ||
{{- .Arch}} | ||
vendor: Friendly Captcha GmbH | ||
homepage: https://github.com/friendlycaptcha/hareply | ||
maintainer: Guido Zuidhof <[email protected]> | ||
description: "hareply - responder for HAProxy's agent-check" | ||
license: MIT | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
bindir: /usr/sbin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why in So I would make this |
||
section: net | ||
priority: optional | ||
contents: | ||
- dst: /etc/hareply | ||
type: dir | ||
file_info: | ||
owner: root | ||
group: root | ||
mode: 0750 | ||
- src: assets/packages/hareply.service | ||
dst: /etc/systemd/system/hareply.service | ||
type: config | ||
file_info: | ||
owner: root | ||
group: root | ||
mode: 0640 | ||
- src: assets/packages/default | ||
dst: /etc/default/hareply | ||
type: config | ||
file_info: | ||
owner: root | ||
group: root | ||
mode: 0640 | ||
scripts: | ||
postinstall: "assets/packages/post-install.sh" | ||
preremove: "assets/packages/pre-uninstall.sh" | ||
postremove: "assets/packages/post-uninstall.sh" | ||
deb: | ||
lintian_overrides: | ||
- statically-linked-binary | ||
- changelog-file-missing-in-native-package | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hareply
doesn't currently listen to this signal, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. This comes from the copy paste from how
dataplaneapi
does things for their systemd service: but we indeed do not need this or use it currently.I'll remove this command entirely, as well as the
PIDFILE
options below