Skip to content

Commit

Permalink
feat: support a shared bucket for backups (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon authored Jul 21, 2023
1 parent 1144245 commit 9e7870a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion legacy/scripts/exec-backup-generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,16 @@ if [[ "${CAPABILITIES[@]}" =~ "backup.appuio.ch/v1alpha1/Schedule" ]]; then
BAAS_BUCKET_NAME=$(echo $LAGOON_PROJECT_VARIABLES | jq -r '.[] | select(.name == "LAGOON_BAAS_BUCKET_NAME") | "\(.value)"')
fi
if [ -z $BAAS_BUCKET_NAME ]; then
BAAS_BUCKET_NAME=baas-${PROJECT}
# check for shared/cluster scoped bucket
# use build scope for now for testing
SHARED_BUCKET_NAME=$(echo $LAGOON_PROJECT_VARIABLES | jq -r '.[] | select(.scope == "internal_system" and .name == "LAGOON_SYSTEM_PROJECT_SHARED_BUCKET") | "\(.value)"')
if [ -z $SHARED_BUCKET_NAME ]; then
# if no shared bucketname, create as normal
BAAS_BUCKET_NAME=baas-${PROJECT}
else
# if shared, create using shared bucketname
BAAS_BUCKET_NAME=${SHARED_BUCKET_NAME}/baas-${PROJECT}
fi
fi

# Pull in .lagoon.yml variables
Expand Down

0 comments on commit 9e7870a

Please sign in to comment.