Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Unverified Commit 371b2077 authored by Idriss's avatar Idriss
Browse files

Better handling multi-region scaleway

parent 178ec2e0
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ mirror:
deliver:
stage: deliver
script:
- setsid ./ci/docker-deliver.sh "bucket-backup" "2.0"
- setsid ./ci/docker-deliver.sh "bucket-backup" "2.1"
only:
refs:
- /^(main.*)$/
......
......@@ -32,11 +32,13 @@ bucket_backup() {
echo "[bucket_backup] Deleting data older than $(date --date="${MAX_RETENTION} days ago" "${DATE_FORMAT}")"
# If you use a scaleway endpoint, there's some specificities to handle
if [[ $endpoint =~ https://.+s3.fr-par.scw.cloud ]]; then
bucket_name="$(echo $endpoint|sed "s/https:\/\/\(.*\)\.s3\.fr\-par\.scw\.cloud/\1/g")"
endpoint="https://s3.fr-par.scw.cloud"
if [[ $endpoint =~ https://.+s3.*.scw.cloud ]]; then
bucket_name="$(echo $endpoint|sed "s/https:\/\/\(.*\)\.s3\..*\.scw\.cloud/\1/g")"
region="$(echo $endpoint|sed "s/https:\/\/.*\.s3\.\(.*\)\.scw\.cloud/\1/g")"
endpoint="https://s3.${region}.scw.cloud"
bucket_subpath=""
[[ $bucket_name ]] && bucket_subpath="${bucket_name}/"
echo "[bucket_backup] region=${region}, bucket_name=${bucket_name}, endpoint=${endpoint}"
fi
"${MC_BIN}" config host add "r${dest}" "${endpoint}" "${access_key}" "${secret_key}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment