-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3d407e
commit dbf1497
Showing
7 changed files
with
148 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ config.yml | |
*.7z | ||
*.exe | ||
*.bin | ||
webhook-go* | ||
webhook.yml | ||
|
||
bin/ | ||
dist/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,28 @@ builds: | |
goarch: arm | ||
- goos: windows | ||
goarch: arm64 | ||
nfpms: | ||
- vendor: Vox Pupuli | ||
homepage: https://github.com/voxpupuli/webhook-go | ||
maintainer: Vox Pupuli <[email protected]> | ||
description: |- | ||
Puppet Webhook API server written in Go. | ||
Designed to provide a web api that can receive | ||
webhooks from VCS services such as GitHub, GitLab, etc | ||
and execute r10k deployments | ||
license: Apache 2.0 | ||
formats: | ||
- deb | ||
- rpm | ||
contents: | ||
- src: build/webhook.yml | ||
dst: /etc/voxpupuli/webhook.yml | ||
type: "config|noreplace" | ||
- src: build/webhook-go.service | ||
dst: /etc/systemd/system/webhook-go.service | ||
scripts: | ||
postinstall: "build/post-install.sh" | ||
postremove: "build/post-remove.sh" | ||
release: | ||
github: | ||
owner: voxpupuli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
|
||
cleanInstall() { | ||
printf "\033[32m Post Install of an clean install\033[0m\n" | ||
printf "\033[32m Reload the service unit from disk\033[0m\n" | ||
systemctl daemon-reload ||: | ||
printf "\033[32m Unmask the service\033[0m\n" | ||
systemctl unmask webhook-go.service ||: | ||
printf "\033[32m Set the preset flag for the service unit\033[0m\n" | ||
systemctl preset webhook-go.service ||: | ||
printf "\033[32m Start the service with systemctl start webhook-go.service\033[0m\n" | ||
printf "\033[32m Enable the service with systemctl enable webhook-go.service\033[0m\n" | ||
} | ||
|
||
upgrade() { | ||
printf "\033[32m Post Install of an upgrade\033[0m\n" | ||
} | ||
|
||
# Step 2, check if this is a clean install or an upgrade | ||
action="$1" | ||
if [ "$1" = "configure" ] && [ -z "$2" ]; then | ||
action="install" | ||
elif [ "$1" = "configure" ] && [ -n "$2" ]; then | ||
action="upgrade" | ||
fi | ||
|
||
case "$action" in | ||
"1" | "install") | ||
cleanInstall | ||
;; | ||
"2" | "upgrade") | ||
printf "\033[32m Post Install of an upgrade\033[0m\n" | ||
upgrade | ||
;; | ||
*) | ||
# $1 == version being installed | ||
printf "\033[32m Alpine\033[0m" | ||
cleanInstall | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
remove() { | ||
printf "\033[32m removing webhook-go\033[0m\n" | ||
systemctl stop webhook-go.service | ||
systemctl disable webhook-go.service | ||
rm -rf /etc/systemd/system/webhook-go.service | ||
systemctl daemon-reload | ||
} | ||
|
||
purge() { | ||
printf "\033[32m Purgins config files\033[0m\n" | ||
rm -rf /etc/voxpupuli/webhook.yml | ||
} | ||
|
||
upgrade() { | ||
echo "" | ||
} | ||
|
||
echo "$@" | ||
|
||
action="$1" | ||
|
||
case "$action" in | ||
"0" | "remove") | ||
remove | ||
;; | ||
"1" | "upgrade") | ||
upgrade | ||
;; | ||
"purge") | ||
purge | ||
;; | ||
*) | ||
printf "\033[32m Alpine\033[0m" | ||
remove | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Puppet Deployment API Server | ||
After=network.target | ||
Documentation=https://github.com/voxpupuli/webhook-go | ||
|
||
[Service] | ||
Environment=GIN_MODE=release | ||
ExecStart=/usr/bin/webhook-go server --config /etc/voxpupuli/webhook.yml | ||
ExecReload=/bin/kill -HUP $PID | ||
KillMode=process | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
Alias=webhook-go.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
server: | ||
protected: true | ||
user: puppet | ||
password: puppet | ||
port: 4000 | ||
tls: | ||
enabled: false | ||
certificate: "" | ||
key: "" | ||
# chatops: | ||
# enabled: false | ||
# service: slack | ||
# channel: "#general" | ||
# user: r10kbot | ||
# auth_token: 12345 | ||
# server_uri: "https://rocketchat.local" | ||
r10k: | ||
config_path: /etc/puppetlabs/r10k/r10k.yaml | ||
# default_branch: webhook_test | ||
allow_uppercase: false | ||
verbose: true | ||
# orchestration: | ||
# enabled: false | ||
# type: bolt | ||
# user: dhollinger | ||
# bolt: | ||
# transport: local | ||
# targets: | ||
# - localhost | ||
# host_key_check: false |
This file was deleted.
Oops, something went wrong.