Skip to content

Commit

Permalink
chore: fix fs restore (#998)
Browse files Browse the repository at this point in the history
* chore: only restore if filestore id is present

* chore: fix permissions
  • Loading branch information
tonsV2 authored Feb 11, 2025
1 parent 474a0e5 commit bfe5113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stacks/dhis2-core/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ releases:
DATABASE_URL="$HOSTNAME/databases/$DATABASE_ID"
echo "DATABASE_URL: $DATABASE_URL"
FILESTORE_ID=$(curl --connect-timeout 10 --retry 5 --retry-delay 1 --fail -L $DATABASE_URL --cookie "accessToken=$IM_ACCESS_TOKEN" | jq -r '.filestoreId')
if [[ -z "$FILESTORE_ID" ]]; then
if [[ "$FILESTORE_ID" == "0" ]]; then
echo "No filestore id associated with database"
else
echo "Filestore ID: $FILESTORE_ID"
echo "Seeding..."
tmp_file=$(mktemp)
Expand All @@ -161,6 +162,7 @@ releases:
tmp_dir=$(mktemp -d /tmp/minio.XXXXXX)
trap 'rm -rf "$tmp_dir"' EXIT # Ensures cleanup on script exit
gunzip -c "$tmp_file" | tar xf - -C "$tmp_dir"
chmod -R u+rwx,go+rx "$tmp_dir"
mc cp --recursive "$tmp_dir"/* myminio/dhis2
Expand Down

0 comments on commit bfe5113

Please sign in to comment.