fix after review
Skeleton contracts / contracts (pull_request) Blocked by required conditions

This commit is contained in:
ivanstorozhev
2026-12-04 16:19:07 +03:00
parent f424658b1d
commit 1a5b824970
13 changed files with 438 additions and 50 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
# Операторский шаг. Ключ Admin живёт только в .env и сюда, в OpenBao API его нет.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
set -a
# shellcheck disable=SC1091
. ./.env
set +a
s3_id="$(docker compose --env-file .env ps -q s3)"
if [ -z "$s3_id" ]; then
echo "s3 is not running" >&2
exit 1
fi
network="$(docker inspect -f '{{range $name, $_ := .NetworkSettings.Networks}}{{$name}}{{end}}' "$s3_id")"
ok=0
for _ in $(seq 1 20); do
if docker run --rm --network "$network" \
-e S3_ENDPOINT=https://s3:8333 \
-e S3_BUCKET="${S3_BUCKET:-messenger-attachments}" \
-e S3_ADMIN_ACCESS \
-e S3_ADMIN_SECRET \
-e CA_FILE=/ca.crt \
-v "$ROOT/secrets/ca/ca.crt:/ca.crt:ro" \
-v "$ROOT/scripts/ensure_bucket.py:/ensure_bucket.py:ro" \
python:3.12-alpine python /ensure_bucket.py; then
ok=1
break
fi
sleep 2
done
if [ "$ok" -ne 1 ]; then
echo "bucket was not created" >&2
exit 1
fi