me-web? skeleton: Avalonia 12 app, server, packaging and CI
Build / Desktop, server and tools (push) Successful in 1m7s
Build / Desktop, server and tools (push) Successful in 1m7s
The first screen (online or not, a Check button, every language with a draft notice), the desktop and Android heads, the server's /api/info and /api/ip, a release tool that builds deb, rpm, a Windows exe, macOS zips, a signed APK and the server, and the Gitea workflows that run it. Rules adapted from passolo; AGPL-3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
commit
7589121846
76 files changed
+3082
No files matched your search
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
archive=$1
|
||||
app=/var/www/meweb.arasaka.software
|
||||
backups=/var/backups/meweb.arasaka.software
|
||||
health=http://127.0.0.1:5480/api/info
|
||||
stamp=$(date -u +%Y%m%d%H%M%S)
|
||||
stage=$(mktemp -d)
|
||||
trap 'rm -rf "$stage"' EXIT
|
||||
|
||||
tar -xzf "$archive" -C "$stage"
|
||||
test -x "$stage/MeWeb.Server"
|
||||
|
||||
snapshot=""
|
||||
if [ -x "$app/MeWeb.Server" ]; then
|
||||
snapshot="$backups/meweb-$stamp"
|
||||
rsync -a "$app/" "$snapshot/"
|
||||
ls -1dt "$backups"/meweb-* 2>/dev/null | tail -n +4 | xargs -r rm -rf
|
||||
fi
|
||||
|
||||
sudo systemctl stop meweb || true
|
||||
rsync -a --delete "$stage/" "$app/"
|
||||
sudo systemctl start meweb
|
||||
|
||||
for attempt in $(seq 1 30); do
|
||||
if curl -fsS "$health" | grep -q "\"commit\":\"$COMMIT\""; then
|
||||
echo "deployed $COMMIT: $(curl -fsS "$health")"
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "::error::the new server did not answer with commit $COMMIT"
|
||||
sudo systemctl status meweb --no-pager | tail -20 || true
|
||||
if [ -n "$snapshot" ]; then
|
||||
sudo systemctl stop meweb || true
|
||||
rsync -a --delete "$snapshot/" "$app/"
|
||||
sudo systemctl start meweb
|
||||
echo "rolled back to $snapshot"
|
||||
fi
|
||||
exit 1
|
||||
Reference in new issue
Block a user