Config for my PI/PDS
1#!/usr/bin/env bash
2
3echo "
4Got new commit: $(date)
5---
6"
7
8# pull latest version
9echo "git fetch --all"
10git fetch --all
11echo "git reset --hard origin/main"
12git reset --hard origin/main
13
14echo "curl -d fetched-latest http://compuper:6500/notify"
15cat <<BODY | curl -d @- http://compuper:6500/notify
16name=vps%3A%20git%20($(git log -1 --pretty=format:%h))\
17&timeout=5000\
18&body=fetched%20latest%20git%20commit%20for%20vielle.dev/pi-config\
19&key=pi/commit/git
20BODY
21
22# restart/rebuild all containers
23echo "docker compose build"
24docker compose build
25echo "docker compose up -d --force-recreate --remove-orphans"
26docker compose up -d --force-recreate --remove-orphans
27
28# clear out dockerfiles to stop my drive exploding
29echo "docker system prune -af"
30docker system prune -af
31
32echo "curl -d ready http://compuper:6500/notify"
33cat <<BODY | curl -d @- http://compuper:6500/notify
34name=pi%3A%20ready%20($(git log -1 --pretty=format:%h))
35&timeout=5000
36&body=finished%20building%20docker
37&key=pi/commit/build
38BODY
39
40exit 0