commit 594e35f481430aaa29dcdf77a587c6e0da63b022 Author: UserA Date: Tue Aug 13 05:09:09 2024 +0300 Simple redeploy webhook pipeline diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b989e0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +webhook +**.tar.gz +webhook-*-*/ diff --git a/fetch.sh b/fetch.sh new file mode 100755 index 0000000..ca18167 --- /dev/null +++ b/fetch.sh @@ -0,0 +1,3 @@ +wget https://github.com/adnanh/webhook/releases/download/2.8.1/webhook-linux-amd64.tar.gz +tar xvf webhook-linux-amd64.tar.gz +cp webhook-linux-amd64/webhook . diff --git a/hooks.json b/hooks.json new file mode 100644 index 0000000..5e32d83 --- /dev/null +++ b/hooks.json @@ -0,0 +1,7 @@ +[ + { + "id": "redeploy-webhook", + "execute-command": "./redeploy.sh", + "command-working-directory": "." + } +] diff --git a/redeploy.sh b/redeploy.sh new file mode 100644 index 0000000..53b6431 --- /dev/null +++ b/redeploy.sh @@ -0,0 +1,6 @@ +cd ~/gits +for d in */; do + cd "$d" + git pull + docker compose restart +done diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..8bc030c --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +./webhook -hooks hooks.json -verbose