All checks were successful
cc-ci/testme cc-ci: success
Replace the one-shot minio-createbuckets service (which required a manual 'abra app restart minio-createbuckets' that appeared to hang) with a minio-initialize.sh config, ported from lasuite-docs. The minio service entrypoint runs it in the background before starting minio; it waits for minio to be ready and idempotently creates the drive-media-storage bucket with versioning. Manual trigger: 'abra app cmd minio minio_initialize'.
30 lines
809 B
Bash
30 lines
809 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Wait for minio to be ready (up to 60 seconds)
|
|
i=0
|
|
while ! mc ready local 2>/dev/null; do
|
|
i=$((i+1))
|
|
if [ "$i" -ge 60 ]; then
|
|
echo "minio-initialize: timed out waiting for minio to be ready" >&2
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
MINIO_ROOT_USER="$(cat /run/secrets/minio_ru)"
|
|
MINIO_ROOT_PASSWORD="$(cat /run/secrets/minio_rp)"
|
|
|
|
mc alias set drive http://localhost:9000 "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"
|
|
|
|
# Idempotent: skip if bucket already exists
|
|
if mc ls drive/drive-media-storage > /dev/null 2>&1; then
|
|
echo "minio-initialize: bucket 'drive-media-storage' already exists, skipping"
|
|
exit 0
|
|
fi
|
|
|
|
echo "minio-initialize: creating bucket 'drive-media-storage'..."
|
|
mc mb drive/drive-media-storage
|
|
mc version enable drive/drive-media-storage
|
|
echo "minio-initialize: done"
|