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

Script to restore stuck updates

parent d845c66d
No related branches found
No related tags found
1 merge request!14Script to restore stuck updates
#!/bin/sh
oc get -o json drupalsite -A | jq -r '.items[] | select(.status.releaseID.current != .status.releaseID.failsafe)|"\(.metadata.name) \(.metadata.namespace) \(.status.releaseID.failsafe)"'| xargs -l bash -c 'export name=$(echo $2 | cut -d"-" -f -2); export spec=$(echo $2 |cut -d"-" -f 3"-"45); echo "[{\"op\": \"replace\",\"path\":\"/spec/version/name\",\"value\":\"${name}\"}, {\"op\":\"replace\",\"path\":\"/spec/version/releaseSpec\",\"value\":\"${spec}\"}]">patchs; oc patch drupalsite/$0 -n $1 --type json --patch-file patchs; sleep 1s'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment