@@ -10,46 +10,6 @@ echo "If this script is run automatically by cron or a timer AND you are using b
10
10
echo " The snapshots of your backup destination should run AFTER the cold standby script finished to ensure consistent snapshots."
11
11
echo
12
12
13
- function docker_garbage() {
14
- IMGS_TO_DELETE=()
15
-
16
- for container in $( grep -oP " image: \Kmailcow.+" docker-compose.yml) ; do
17
-
18
- REPOSITORY=${container/:* }
19
- TAG=${container/*: }
20
- V_MAIN=${container/* .}
21
- V_SUB=${container/* .}
22
- EXISTING_TAGS=$( docker images | grep ${REPOSITORY} | awk ' { print $2 }' )
23
-
24
- for existing_tag in ${EXISTING_TAGS[@]} ; do
25
-
26
- V_MAIN_EXISTING=${existing_tag/* .}
27
- V_SUB_EXISTING=${existing_tag/* .}
28
-
29
- # Not an integer
30
- [[ ! ${V_MAIN_EXISTING} =~ ^[0-9]+$ ]] && continue
31
- [[ ! ${V_SUB_EXISTING} =~ ^[0-9]+$ ]] && continue
32
-
33
- if [[ ${V_MAIN_EXISTING} == " latest" ]]; then
34
- echo " Found deprecated label \" latest\" for repository ${REPOSITORY} , it should be deleted."
35
- IMGS_TO_DELETE+=(${REPOSITORY} :${existing_tag} )
36
- elif [[ ${V_MAIN_EXISTING} -lt ${V_MAIN} ]]; then
37
- echo " Found tag ${existing_tag} for ${REPOSITORY} , which is older than the current tag ${TAG} and should be deleted."
38
- IMGS_TO_DELETE+=(${REPOSITORY} :${existing_tag} )
39
- elif [[ ${V_SUB_EXISTING} -lt ${V_SUB} ]]; then
40
- echo " Found tag ${existing_tag} for ${REPOSITORY} , which is older than the current tag ${TAG} and should be deleted."
41
- IMGS_TO_DELETE+=(${REPOSITORY} :${existing_tag} )
42
- fi
43
-
44
- done
45
-
46
- done
47
-
48
- if [[ ! -z ${IMGS_TO_DELETE[*]} ]]; then
49
- docker rmi ${IMGS_TO_DELETE[*]}
50
- fi
51
- }
52
-
53
13
function preflight_local_checks() {
54
14
if [[ -z " ${REMOTE_SSH_KEY} " ]]; then
55
15
>&2 echo -e " \e[31mREMOTE_SSH_KEY is not set\e[0m"
0 commit comments