From 66e065dff5820ac60c4825dc3f9922cad40ecdb6 Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Thu, 28 May 2026 23:08:11 +0100 Subject: [PATCH] feat(2): lasuite-drive setup creates MinIO bucket via createbuckets one-shot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In-flight Q3.2 iteration (NOT yet live-verified — needs a lasuite-drive deploy once the warm keycloak from Phase 2w is available). Phase 2 paused here per operator interjection of Phase 2w; state preserved. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/lasuite-drive/setup_custom_tests.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/lasuite-drive/setup_custom_tests.sh b/tests/lasuite-drive/setup_custom_tests.sh index 12c7ec8..2b7623d 100644 --- a/tests/lasuite-drive/setup_custom_tests.sh +++ b/tests/lasuite-drive/setup_custom_tests.sh @@ -31,6 +31,27 @@ KC_SECRET=$(jq -r '.keycloak.client_secret' "$CCCI_DEPS_FILE") echo " lasuite-drive setup_custom_tests: wiring OIDC against keycloak dep ${KC_DOMAIN}" +# 0) Recipe post-deploy setup (lasuite-drive README): the deploy alone does NOT create the MinIO +# bucket — `minio-createbuckets` is a `replicas:0` one-shot that must be triggered. The MinIO +# storage test asserts the bucket exists, so create it here. We scale the one-shot to 1 directly +# (deterministic) rather than the README's finicky `abra app restart` (which it notes "will appear +# to fail"). (DB `backend migrate` is the README's other documented step; not run here because +# neither current test needs a migrated DB — add it when an upload-via-app test does.) +STACK=$(printf '%s' "$CCCI_APP_DOMAIN" | tr '.' '_') +echo " setup: creating MinIO bucket via the minio-createbuckets one-shot (scale 0->1)" +docker service scale "${STACK}_minio-createbuckets=1" >/dev/null 2>&1 || true +# Wait up to 90s for the one-shot to create the bucket (mc mb drive/drive-media-storage; exit 0). +# Poll by checking the bucket directly from the running minio replica container. +for i in $(seq 1 30); do + MC_CID=$(docker ps -q -f "name=${STACK}_minio.1" | head -1) + if [ -n "$MC_CID" ] && docker exec "$MC_CID" sh -c \ + 'mc alias set _c http://localhost:9000 "$(cat /run/secrets/minio_ru)" "$(cat /run/secrets/minio_rp)" >/dev/null 2>&1 && mc ls _c/drive-media-storage >/dev/null 2>&1'; then + echo " setup: bucket drive-media-storage present after ${i} poll(s)" + break + fi + sleep 3 +done + # 1) Insert the OIDC client secret at a bumped version (the recipe-maintainer pattern; abra already # generated oidc_rpcs:v1 randomly and swarm forbids overwriting a secret at the same version). ENV_PATH="$HOME/.abra/servers/default/${CCCI_APP_DOMAIN}.env"