Browse Source

start/stop/update apps in parallel (#834)

rtl-0.11.0
Luke Childs 4 years ago
committed by GitHub
parent
commit
a4c3837f19
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      scripts/app
  2. 5
      scripts/update/01-run.sh

7
scripts/app

@ -80,11 +80,12 @@ else
app_dir="${UMBREL_ROOT}/apps/${app}"
app_data_dir="${UMBREL_ROOT}/app-data/${app}"
if [[ "${app}" == "installed" ]]; then
list_installed_apps | while read app; do
for app in $(list_installed_apps); do
if [[ "${app}" != "" ]]; then
"${0}" "${1}" "${app}" "${@:3}" || true
"${0}" "${1}" "${app}" "${@:3}" &
fi
done
wait
exit
fi
if [[ -z "${app}" ]] || [[ ! -d "${app_dir}" ]]; then
@ -156,7 +157,7 @@ if [[ "$command" = "install" ]]; then
echo "Setting up data dir for app ${app}..."
mkdir -p "${app_data_dir}"
rsync --archive --verbose --exclude ".gitkeep" "${app_dir}/." "${app_data_dir}"
echo "Pulling images for app ${app}..."
compose "${app}" pull

5
scripts/update/01-run.sh

@ -106,12 +106,13 @@ 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
for app in $(list_installed_apps); do
if [[ "${app}" != "" ]]; then
echo "${app}..."
scripts/app compose "${app}" pull
scripts/app compose "${app}" pull &
fi
done
wait
# Stop existing containers
echo "Stopping existing containers"

Loading…
Cancel
Save