-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideas.txt
58 lines (49 loc) · 2.47 KB
/
ideas.txt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Can't be used yet with current backup naming scheme
function restore {
echo -e "${ORANGE}Restore not implemented at the moment!${NC}"
echo -e "${ORANGE}To restore, do the following:${NC}"
echo -e "${ORANGE}1. Stop your stack${NC}"
echo -e "${ORANGE}2. Move your stack directory${NC}"
echo -e "${ORANGE}3. Extract the backup${NC}"
echo -e "${ORANGE}4. (Optionally) Replace all the image tags with repo_digest from versions.txt${NC}"
echo -e "${ORANGE}5. Pull images${NC}"
echo -e "${ORANGE}6. Start your stack${NC}"
#echo "Stopping stack"
#$COMPOSE_COMMAND -f "$COMPOSE_FILE_WITH_PATH" down
#read -r -p "Continue with Enter or cancel with CTRL+C..."
#echo "Restoring backup"
#randstr=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c"${1:-8}";echo;)
#mv "$STACK_FOLDER_WITH_PATH" "${STACK_FOLDER_WITH_PATH}.$randstr"
#mkdir -p "$STACK_FOLDER_WITH_PATH"
#$UNZIP_COMMAND --stdout "$BACKUP_LOCATION"/"$STACK_FOLDER_NAME"-"$DATE".tar.gz | pv -s "$(du -sb "$BACKUP_LOCATION"/"$STACK_FOLDER_NAME"-"$DATE".tar.gz | awk '{print $1}')" | tar -C "$STACK_FOLDER_WITH_PATH"/.. -xf -
#while IFS= read -r line; do
# image_name=$(echo "$line" | awk -F, '{print $2}')
# repo_digest=$(echo "$line" | awk -F, '{print $3}')
# sed -i "s#image: ${image_name}#image: ${repo_digest}#g" "$COMPOSE_FILE_WITH_PATH"
#done < <(cat "$VERSIONS_FILE_WITH_PATH")
#read -r -p "Continue with Enter or cancel with CTRL+C..."
#echo "Pulling images"
#$COMPOSE_COMMAND -f "$COMPOSE_FILE_WITH_PATH" pull
#read -r -p "Continue with Enter or cancel with CTRL+C..."
#echo "Starting stack"
#$COMPOSE_COMMAND -f "$COMPOSE_FILE_WITH_PATH" up -d
#read -r -p "Continue with Enter or cancel with CTRL+C..."
}
# Can't be used yet with current backup naming scheme
function resume {
echo -e "${ORANGE}Resume not implemented at the moment!${NC}"
#echo "Resuming"
#while IFS= read -r line; do
# image_name="$(echo "$line" | awk -F, '{print $2}')"
# repo_digest="$(echo "$line" | awk -F, '{print $3}')"
# sed -i "s#image: ${repo_digest}#image: ${image_name}#g" "$COMPOSE_FILE_WITH_PATH"
#done < <(cat "$VERSIONS_FILE_WITH_PATH")
#read -r -p "Continue with Enter or cancel with CTRL+C..."
#echo "Pulling images"
#$COMPOSE_COMMAND -f "$COMPOSE_FILE_WITH_PATH" pull
#read -r -p "Continue with Enter or cancel with CTRL+C..."
#echo "Starting stack"
#$COMPOSE_COMMAND -f "$COMPOSE_FILE_WITH_PATH" up -d
#read -r -p "Continue with Enter or cancel with CTRL+C..."
}