Browse Source

Pull new app containers on update (#364)

dashboard-0.3.14
Luke Childs 4 years ago
committed by GitHub
parent
commit
35007d1bc2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      scripts/app
  2. 16
      scripts/update/01-run.sh

10
scripts/app

@ -18,6 +18,7 @@ Commands:
stop Stops an installed app
start Starts an installed app
compose Passes all arguments to docker-compose
ls-installed Lists installed apps
EOF
}
@ -31,7 +32,7 @@ check_dependencies () {
}
list_installed_apps() {
cat "${USER_FILE}" | jq -r 'if has("installedApps") then .installedApps else [] end | join("\n")' || true
cat "${USER_FILE}" 2> /dev/null | jq -r 'if has("installedApps") then .installedApps else [] end | join("\n")' || true
}
# Check dependencies
@ -43,6 +44,13 @@ else
command="$1"
fi
# Lists installed apps
if [[ "$command" = "ls-installed" ]]; then
list_installed_apps
exit
fi
if [ -z ${2+x} ]; then
show_help
exit 1

16
scripts/update/01-run.sh

@ -81,6 +81,22 @@ cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
EOF
docker-compose pull
echo "Updating installed apps"
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
{"state": "installing", "progress": 60, "description": "Updating installed apps", "updateTo": "$RELEASE"}
EOF
# We can just loop over this once everyone has the latest app script
# "$UMBREL_ROOT/scripts/app" ls-installed
# but for now we need to implement it here manually
USER_FILE="${UMBREL_ROOT}/db/user.json"
list_installed_apps() {
cat "${USER_FILE}" 2> /dev/null | jq -r 'if has("installedApps") then .installedApps else [] end | join("\n")' || true
}
list_installed_apps | while read app; do
echo "${app}..."
scripts/app compose "${app}" pull
done
# Stop existing containers
echo "Stopping existing containers"
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json

Loading…
Cancel
Save