feat: prepare instalation script
This commit is contained in:
parent
61a5fc289f
commit
c00fa8bee6
4 changed files with 63 additions and 0 deletions
24
src/etc/webhook/hooks.yaml
Normal file
24
src/etc/webhook/hooks.yaml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
- id: deploy
|
||||||
|
execute-command: "/var/ingress.tjo.cloud/src/install.sh"
|
||||||
|
command-working-directory: "/var/ingress.tjo.cloud/"
|
||||||
|
pass-arguments-to-command:
|
||||||
|
- source: payload
|
||||||
|
name: "head_commit.id"
|
||||||
|
- source: payload
|
||||||
|
name: "pusher.name"
|
||||||
|
- source: payload
|
||||||
|
name: "pusher.email"
|
||||||
|
trigger-rule:
|
||||||
|
and:
|
||||||
|
- match:
|
||||||
|
type: payload-hmac-sha256
|
||||||
|
secret: "FIGURE_OUT_HOW_TO_SET_THIS"
|
||||||
|
parameter:
|
||||||
|
source: header
|
||||||
|
name: X-Forgejo-Signature
|
||||||
|
- match:
|
||||||
|
type: value
|
||||||
|
value: "push"
|
||||||
|
parameter:
|
||||||
|
source: ref
|
||||||
|
ref: "ref/heads/main"
|
31
src/install.sh
Executable file
31
src/install.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##
|
||||||
|
# Dependencies
|
||||||
|
apt update -y
|
||||||
|
|
||||||
|
apt install -y \
|
||||||
|
git \
|
||||||
|
webhook \
|
||||||
|
nginx \
|
||||||
|
nginx-extras \
|
||||||
|
libnginx-mod-http-geoip2 \
|
||||||
|
libnginx-mod-stream-geoip2
|
||||||
|
|
||||||
|
##
|
||||||
|
# Copy Sysmtemd service/units
|
||||||
|
cp -r etc/systemd/* /etc/systemd/
|
||||||
|
|
||||||
|
##
|
||||||
|
# Ensure services are enabled
|
||||||
|
systemctl enable --now nginx webhook
|
||||||
|
|
||||||
|
##
|
||||||
|
# Configure NGINX
|
||||||
|
cp -r etc/nginx/* /etc/nginx/
|
||||||
|
systemctl reload nginx
|
||||||
|
|
||||||
|
##
|
||||||
|
# Configure Webhook
|
||||||
|
cp -r etc/webhook/* /etc/webhook/
|
||||||
|
systemctl reload webhook
|
0
src/systemd/system/geo-ip-update.timer
Normal file
0
src/systemd/system/geo-ip-update.timer
Normal file
8
src/systemd/system/webhook.service
Normal file
8
src/systemd/system/webhook.service
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Webhooks
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/webhook -hooks /etc/webhook/hooks.json -port 7777 -verbose
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue