ai/at
1
0

fix install.zsh

This commit is contained in:
2026-02-20 07:08:04 +09:00
parent f4180e0c54
commit b6f7d8bed1

View File

@@ -381,20 +381,66 @@ EOF
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
} }
function at-repos-docker-verify() {
local service=$1
local image="at-${service}:latest"
local check_file=""
case $service in
pds) check_file="/app/services/pds/index.js" ;;
bsky) check_file="/app/services/bsky/api.js" ;;
ozone) check_file="/app/services/ozone/api.js" ;;
bgs) check_file="/bigsky" ;;
plc) check_file="/app/packages/server/dist/index.js" ;;
*) return 0 ;;
esac
if docker run --rm "$image" test -f "$check_file" 2>/dev/null; then
echo " ✅ Verified: $check_file exists"
return 0
else
echo " ❌ FAILED: $check_file not found in $image"
return 1
fi
}
function at-repos-build-docker-atproto() { function at-repos-build-docker-atproto() {
cd $d cd $d
docker image prune -a local failed=()
if [ -z "$1" ];then if [ -z "$1" ];then
for ((i=1; i<=${#services}; i++)); do for ((i=1; i<=${#services}; i++)); do
service=${services[$i]} service=${services[$i]}
docker compose build --no-cache $service echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔨 Building: $service"
if ! docker compose build --no-cache $service; then
echo " ❌ Build failed: $service"
failed+=($service)
continue
fi
if ! at-repos-docker-verify $service; then
failed+=($service)
continue
fi
if [ "$service" = "ozone" ]; then if [ "$service" = "ozone" ]; then
docker compose build --no-cache ${service}-web docker compose build --no-cache ${service}-web
fi fi
done done
else else
docker compose build --no-cache $1 echo "🔨 Building: $1"
if ! docker compose build --no-cache $1; then
echo "❌ Build failed: $1"
return 1
fi
if ! at-repos-docker-verify $1; then
return 1
fi
fi fi
if [ ${#failed[@]} -gt 0 ]; then
echo ""
echo "❌ Failed builds: ${failed[*]}"
echo "⚠️ Do NOT push these images."
return 1
fi
echo ""
echo "✅ All builds verified successfully."
} }
function at-repos-push-reset() { function at-repos-push-reset() {
@@ -412,25 +458,41 @@ function at-repos-push-reset() {
} }
function at-repos-push-docker() { function at-repos-push-docker() {
local dtag=$(date +%Y%m%d)
if [ -z "$1" ] || [ "$1" = "push" ]; then if [ -z "$1" ] || [ "$1" = "push" ]; then
for service in "${services[@]}"; do for service in "${services[@]}"; do
if ! at-repos-docker-verify $service; then
echo "⚠️ Skipping push: $service (verification failed)"
continue
fi
docker tag at-${service}:latest localhost:${dport}/${service}:latest docker tag at-${service}:latest localhost:${dport}/${service}:latest
docker tag at-${service}:latest localhost:${dport}/${service}:${dtag}
docker push localhost:${dport}/${service}:latest docker push localhost:${dport}/${service}:latest
docker push localhost:${dport}/${service}:${dtag}
if [ "$service" = "ozone" ]; then if [ "$service" = "ozone" ]; then
docker tag at-${service}-web:latest localhost:${dport}/${service}-web:latest docker tag at-${service}-web:latest localhost:${dport}/${service}-web:latest
docker tag at-${service}-web:latest localhost:${dport}/${service}-web:${dtag}
docker push localhost:${dport}/${service}-web:latest docker push localhost:${dport}/${service}-web:latest
docker push localhost:${dport}/${service}-web:${dtag}
fi fi
done done
else else
if ! at-repos-docker-verify $1; then
echo "❌ Push aborted: $1 (verification failed)"
return 1
fi
docker tag at-${1}:latest localhost:${dport}/${1}:latest docker tag at-${1}:latest localhost:${dport}/${1}:latest
docker tag at-${1}:latest localhost:${dport}/${1}:${dtag}
docker push localhost:${dport}/${1}:latest docker push localhost:${dport}/${1}:latest
docker push localhost:${dport}/${1}:${dtag}
fi fi
echo "📦 Pushed with tags: latest, ${dtag}"
} }
function at-repos-pull-docker() { function at-repos-pull-docker() {
cd $d cd $d
docker image prune -a
docker compose up -d --pull always docker compose up -d --pull always
echo "💡 Run 'docker image prune' manually to clean up old images."
} }
function at-repos-reset-bgs-db() { function at-repos-reset-bgs-db() {