forked from hjensas/dev-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoc_mirror_cleanup.sh
More file actions
executable file
·33 lines (26 loc) · 863 Bytes
/
oc_mirror_cleanup.sh
File metadata and controls
executable file
·33 lines (26 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -euxo pipefail
source common.sh
if [ -d "${WORKING_DIR}/mirror-registry" ]; then
pushd ${WORKING_DIR}/mirror-registry
sudo ./mirror-registry uninstall --quayRoot ${WORKING_DIR}/quay-install/ -v --autoApprove
popd
rm -rf "${WORKING_DIR}/mirror-registry"
fi
if [[ -f "/usr/local/bin/oc-mirror" ]]; then
sudo rm "/usr/local/bin/oc-mirror"
fi
if [ -f "${WORKING_DIR}/.oc-mirror.log" ]; then
rm "${WORKING_DIR}/.oc-mirror.log"
fi
if [ -d "${WORKING_DIR}/oc-mirror-workspace" ]; then
rm -rf "${WORKING_DIR}/oc-mirror-workspace"
fi
if [ -d "${WORKING_DIR}/quay-install" ]; then
rm -rf "${WORKING_DIR}/quay-install"
fi
# restore docker config file that was updated with auth settings
if [[ -f ${DOCKER_CONFIG_FILE}.old ]]; then
cp ${DOCKER_CONFIG_FILE}.old ${DOCKER_CONFIG_FILE}
rm ${DOCKER_CONFIG_FILE}.old
fi