add akkoma's (bash scripts i use)

This commit is contained in:
2026-07-16 22:17:46 +02:00
parent d70dd8d601
commit 9b7c0be73e
5 changed files with 76 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"
echo "stop akkoma..."
docker compose down
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
URL="http://127.0.0.1:4000"
TIMEOUT=120
INTERVAL=2
ELAPSED=0
echo "waiting for akkoma to return 200; $URL ..."
while true; do
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" || echo "000")
if [ "$CODE" = "200" ]; then
echo "akkoma is up (HTTP $CODE) after ${ELAPSED}s"
exit 0
fi
if [ "$ELAPSED" -ge "$TIMEOUT" ]; then
echo "timed out ${TIMEOUT}, status: $CODE)"
exit 1
fi
echo " [$ELAPSED s] not ready yet, status: $CODE) ..."
sleep "$INTERVAL"
ELAPSED=$((ELAPSED + INTERVAL))
done
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"
echo "reloading confs..."
docker compose restart akkoma
sleep 3
docker compose logs --tail 30 akkoma
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
echo "start akkoma..."
docker compose up -d
sleep 3
docker compose ps
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"
echo "fetch latest..."
git fetch origin stable
git checkout stable
git pull origin stable
echo "rebuild imgs..."
docker compose build akkoma
echo "get new deps..."
docker compose run --rm akkoma mix deps.get
echo "compile..."
docker compose run --rm akkoma mix compile
echo "migrate..."
docker compose run --rm akkoma mix ecto.migrate
echo "restart..."
docker compose up -d
echo "done!"
docker compose ps