Skip to content
Snippets Groups Projects
Commit ed36c121 authored by Oleksandr Kosse (EPAM)'s avatar Oleksandr Kosse (EPAM)
Browse files

Merge branch 'GONRG-5872-Policy-Bootstrap-Refactor' into 'master'

[GONRG-5872] Confgire rsync in bootstrap to leave existing objects

See merge request !274
parents 491be1a8 9cd5c99a
No related branches found
No related tags found
3 merge requests!299Update Dev branch,!298Securityfix,!274[GONRG-5872] Confgire rsync in bootstrap to leave existing objects
Pipeline #157498 failed
......@@ -27,19 +27,29 @@ create_partition_bundle() {
bootstrap_gcs() {
echo "Push archives to GCS bucket"
gsutil rsync /opt/policies gs://"${POLICY_BUCKET}"/
gsutil cp -n /opt/policies/* gs://"${POLICY_BUCKET}"/
echo "Bootstrap finished successfully"
}
bootstrap_minio() {
echo "Installing Minio Client (mc) tool"
apk add wget
wget https://dl.min.io/client/mc/release/linux-amd64/mc
wget --quiet https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc && mv mc /usr/bin/mc
echo "mc tool installed successfully, configuring"
mc alias set minio "${MINIO_HOST}":"${MINIO_PORT}" "${MINIO_ACCESS_KEY}" "${MINIO_SECRET_KEY}"
echo "Push archives to Minio bucket"
mc mirror --overwrite /opt/policies minio/"${POLICY_BUCKET}"
echo "Pushing archives to Minio bucket"
for file in /opt/policies/*;
do
echo "Processing $file:"
file_name=${file##*/}
# Check if file already exists
if mc stat minio/"${POLICY_BUCKET}"/"$file_name" > /dev/null 2>&1; then
echo "Skipping $file: already exists in bucket"
else
mc cp "$file" minio/"${POLICY_BUCKET}"/"$file_name"
fi
done
echo "Bootstrap finished successfully"
}
......
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