Skip to content

Commit

Permalink
feat: support a shared bucket for backups
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jul 6, 2023
1 parent 38694d1 commit e7891ac
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion legacy/scripts/exec-backup-generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,17 @@ 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)"')
SHARED_BUCKET_NAME=$(echo $LAGOON_PROJECT_VARIABLES | jq -r '.[] | select(.scope == "build" 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 e7891ac

Please sign in to comment.