Skip to content

Instantly share code, notes, and snippets.

@supersonictw
Last active December 5, 2025 15:02
Show Gist options
  • Select an option

  • Save supersonictw/4fb9fad435786592f1fa921c912a8454 to your computer and use it in GitHub Desktop.

Select an option

Save supersonictw/4fb9fad435786592f1fa921c912a8454 to your computer and use it in GitHub Desktop.
#!/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"
- 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
#!/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