Skip to content
Snippets Groups Projects
Commit 7df52a22 authored by Francisco Borges Aurindo Barros's avatar Francisco Borges Aurindo Barros
Browse files

Updated DrupalSite backup task, as it had misleading message and arbitrary timeout

parent d4009015
No related tags found
1 merge request!24Updated DrupalSite backup task, as it had misleading message and arbitrary timeout
Pipeline #5354342 passed
......@@ -38,6 +38,10 @@ spec:
export PROJECT_HASH=$(printf '%s' "$NAMESPACE" | md5sum | awk '{print $1}')
export VELERO_NAMESPACE={{ .Values.veleroNamespace }}
envsubst < /tekton-task-templates/backup_resource.yaml | oc create -f -
timeout 120s sh -c -- 'while [[ $(oc get "backup/$RESOURCE_NAME" -n "$VELERO_NAMESPACE" -o jsonpath='{.status.phase}') != "Completed" ]]; do printf "Backup in progress\n"; sleep 2s; done'
backupStatus=$(oc get backup/$RESOURCE_NAME -n $VELERO_NAMESPACE -o=jsonpath='{.status.phase}' | grep -i -E 'failed|completed|partiallyfailed' || echo "Failed")
echo "DrupalSite backup status: $backupStatus"
BACKUP_STATE=$(oc get "backup/$RESOURCE_NAME" -n "$VELERO_NAMESPACE" -o jsonpath='{.status.phase}');
# While the backup is pending OR inProgress, we wait
while [[ ${BACKUP_STATE,,} == "inprogress" || ${BACKUP_STATE,,} == "pending" ]] ; do printf "Backup in state $STATE"; sleep 3s; BACKUP_STATE=$(oc get "backup/$RESOURCE_NAME" -n "$VELERO_NAMESPACE" -o jsonpath='{.status.phase}') ; done
echo "DrupalSite backup status: $BACKUP_STATE"
if [[ ${BACKUP_STATE,,} != "completed" ]]; then
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment