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

Merge branch 'fix-restore-pvs' into 'master'

Update command for fetching pod name

See merge request !13
parents a1f732b3 b730f497
No related branches found
No related tags found
1 merge request!13Update command for fetching pod name
Pipeline #3502082 passed
......@@ -2,7 +2,9 @@ FROM gitlab-registry.cern.ch/paas-tools/openshift-client
LABEL maintainer="Drupal Admins <drupal-admins@cern.ch>"
ARG restic_version=0.12.0
# https://copr.fedorainfracloud.org/coprs/copart/restic/ repo only supporting a fixed version of restic. Hence bumping up restic version from 0.12.0 to 0.12.1
# TODO: Download the binary for restic install, instead of using copart/restic repo
ARG restic_version=0.12.1
RUN yum install epel-release -y && \
# install restic
......
......@@ -38,8 +38,9 @@ chmod 777 /restore
restic -p /tmp/repository-password -r "$RESTIC_REPO" restore "$RESTIC_SNAPSHOT_ID" --target /restore
# Fetch the pod name from the drupalSite env var
POD_NAME=`oc get pods -l app=drupal,drupalSite="$DRUPALSITE" -o name -n "$NAMESPACE" | sed "s/pod\///g" | head -n 1`
# Fetch the most recent pod name from the drupalSite env var
sleep 60s
POD_NAME=`oc get pod -l app=drupal,drupalSite="$DRUPALSITE" -n "$NAMESPACE" --sort-by=.metadata.creationTimestamp --field-selector=status.phase==Running -o jsonpath="{.items[-1:].metadata.name}"`
validateVar "$POD_NAME" "POD_NAME"
oc rsync /restore/ "$POD_NAME":/drupal-data --delete -n "$NAMESPACE" -c php-fpm
......
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