Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOTE-886: Flush image files after downsync restore #716

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/pipeline/downsync-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ echo "Cleaning up old connections..."
## Clean up.
rm -rf restore.txt ~/.mysql backup_${BACKUP_ENV}.sql

echo "Running 'drush cr' on '${BACKUP_ENV}' database..."
echo "Running 'drush cr' on '${RESTORE_ENV}' database..."
source $(pwd $(dirname $0))/scripts/pipeline/cloud-gov-remote-command.sh "${project}-drupal-${RESTORE_ENV}" "drush cr"

# Upload media files.
Expand All @@ -79,8 +79,11 @@ echo "Uploading media files..."
export AWS_DEFAULT_REGION=$(echo "${s3_credentials}" | jq -r '.credentials.region')
export AWS_SECRET_ACCESS_KEY=$(echo "${s3_credentials}" | jq -r '.credentials.secret_access_key')

# Sync files to restore env, deleting those not found from backup env.
# Sync files to restore env, deleting those not found in backup env.
aws s3 sync --no-verify-ssl --delete ${backup_media}/ s3://${bucket}/${backup_media} 2>/dev/null

cf delete-service-key "${service}" "${service_key}" -f
} >/dev/null 2>&1

echo "Running 'drush image-flush --all' on '${RESTORE_ENV}'..."
source $(pwd $(dirname $0))/scripts/pipeline/cloud-gov-remote-command.sh "${project}-drupal-${RESTORE_ENV}" "drush image-flush --all"