Skip to content
Snippets Groups Projects
Commit b977b84e authored by Konstantinos Samaras-Tsakiris's avatar Konstantinos Samaras-Tsakiris
Browse files

Merge branch 'restore-stuck-updates' into 'master'

Script to restore stuck updates

Closes webservices/webframeworks-planning#816

See merge request !14
parents d845c66d 162c11dc
No related branches found
No related tags found
1 merge request!14Script to restore stuck updates
Pipeline #3927903 passed
......@@ -14,7 +14,8 @@ RUN yum update -y && \
yum install restic-${restic_version} -y && \
# we need this to interact with manila OpenStack to get CephFS information
yum install centos-release-openstack-xena -y && \
yum install -y /usr/bin/openstack python3-requests-kerberos && \
# Openstack installation broken, see: https://gitlab.cern.ch/drupal/paas/drupal-operations/-/jobs/21224622
# yum install -y /usr/bin/openstack --disableplugin=protectbase && \
yum clean all
COPY ./tekton-task-templates /tekton-task-templates
......
#!/bin/sh
### FILTERs
STUCK_WEBSITE_FILTER='.status.releaseID.current != .status.releaseID.failsafe'
WEBSITE_LIST_OUTPUT='(.metadata.name + " " + .metadata.namespace + " " + .status.releaseID.failsafe)'
# Time between patches not to overwhelm the Operator
# This can be skipped/reduced once we have this issue closed: https://gitlab.cern.ch/webservices/webframeworks-planning/-/issues/869
export GRACE_PERIOD="1s"
## NB: This will match the spec of all websites based on failStatus version
##
oc get -o json drupalsite -A |
jq -r ".items[] | select(${STUCK_WEBSITE_FILTER}) | ${WEBSITE_LIST_OUTPUT}" |
# Retrieve Spec Name from failSafe status
xargs -l bash -c 'export name=$(echo $2 | cut -d"-" -f -2);
# Retrieve spec ReleaseID from failsafe status
export spec=$(echo $2 |cut -d"-" -f 3"-"45);
# Generate Patch to be applied
cat > patch.yaml <<EOF
spec:
version:
name: ${name}
releaseSpec: ${spec}
EOF
oc patch drupalsite/$0 -n $1 --type=merge --patch-file patch.yaml;
sleep ${GRACE_PERIOD}'
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