mirror of https://github.com/lukechilds/umbrel.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
RELEASE=$1
|
|
UMBREL_ROOT=$2
|
|
|
|
echo
|
|
echo "======================================="
|
|
echo "============= OTA UPDATE =============="
|
|
echo "======================================="
|
|
echo "=========== Stage: Success ============"
|
|
echo "======================================="
|
|
echo
|
|
|
|
# Delete previous (unused) images
|
|
echo "Deleting previous images"
|
|
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
|
|
{"state": "installing", "progress": 90, "description": "Deleting previous images", "updateTo": "$RELEASE"}
|
|
EOF
|
|
docker image prune --all --force
|
|
|
|
# Cleanup
|
|
echo "Removing backup"
|
|
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
|
|
{"state": "installing", "progress": 95, "description": "Removing backup"}
|
|
EOF
|
|
[[ -d "$UMBREL_ROOT"/.umbrel-backup ]] && rm -rf "$UMBREL_ROOT"/.umbrel-backup
|
|
|
|
echo "Successfully installed Umbrel $RELEASE"
|
|
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
|
|
{"state": "success", "progress": 100, "description": "Successfully installed Umbrel $RELEASE", "updateTo": ""}
|
|
EOF
|
|
|