Last active
December 5, 2025 15:02
-
-
Save supersonictw/4fb9fad435786592f1fa921c912a8454 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/sh | |
| # app-update.sh - Update application from git | |
| # # SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR) | |
| set -e | |
| APP_NAME="$(basename $PWD)" | |
| if [ -z "$APP_NAME" ]; then | |
| echo "APP_NAME is empty." | |
| exit 1 | |
| fi | |
| git pull origin main | |
| pm2 restart "$APP_NAME" |
This file contains hidden or 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
| - id: your-application@update | |
| command-working-directory: "/srv/your-application" | |
| execute-command: "/etc/webhook/scripts/app-update.sh" | |
| trigger-rule: | |
| match: | |
| type: value | |
| value: app-update-secret # openssl rand -hex 16 | |
| parameter: | |
| source: url | |
| name: secret |
This file contains hidden or 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
| #!/sbin/openrc-run | |
| name=$RC_SVCNAME | |
| description="Webhook" | |
| supervisor="supervise-daemon" | |
| command="/usr/bin/webhook" | |
| command_args="-hooks /etc/webhook/hooks.yaml -logfile /var/log/webhook.log -nopanic -ip 127.0.0.1 -port 9000" | |
| supervise_daemon_args=" -d /etc/webhook" | |
| depend() { | |
| after net | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment