Browse Source

Clarify app logs (#367)

dashboard-0.3.14
Mayank Chhabra 4 years ago
committed by GitHub
parent
commit
b9c1bb8d46
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      scripts/app

16
scripts/app

@ -109,36 +109,38 @@ update_installed_apps() {
# Pulls down images for an app and starts it # Pulls down images for an app and starts it
if [[ "$command" = "install" ]]; then if [[ "$command" = "install" ]]; then
echo "Pulling images for ${app}..." echo "Pulling images for app ${app}..."
compose "${app}" pull compose "${app}" pull
echo "Setting up data dir for ${app}..." echo "Setting up data dir for app ${app}..."
mkdir -p "${app_data_dir}" mkdir -p "${app_data_dir}"
rsync --archive --verbose --exclude ".gitkeep" "${app_dir}/." "${app_data_dir}" rsync --archive --verbose --exclude ".gitkeep" "${app_dir}/." "${app_data_dir}"
echo "Starting app ${app}..." echo "Starting app ${app}..."
compose "${app}" up --detach compose "${app}" up --detach
echo "Saving installed app in DB" echo "Saving app ${app} in DB..."
update_installed_apps add "${app}" update_installed_apps add "${app}"
echo "Successfully installed app ${app}"
exit exit
fi fi
# Removes images and destroys all data for an app # Removes images and destroys all data for an app
if [[ "$command" = "uninstall" ]]; then if [[ "$command" = "uninstall" ]]; then
echo "Removing app images" echo "Removing images for app ${app}..."
compose "${app}" down --rmi all --remove-orphans compose "${app}" down --rmi all --remove-orphans
echo "Deleting app data for ${app}..." echo "Deleting app data for app ${app}..."
if [[ -d "${app_data_dir}" ]]; then if [[ -d "${app_data_dir}" ]]; then
rm -rf "${app_data_dir}" rm -rf "${app_data_dir}"
fi fi
echo "Removing installed app from DB" echo "Removing app ${app} from DB..."
update_installed_apps remove "${app}" update_installed_apps remove "${app}"
echo "Successfully uninstalled app ${app}"
exit exit
fi fi
@ -155,7 +157,7 @@ fi
if [[ "$command" = "start" ]]; then if [[ "$command" = "start" ]]; then
if ! list_installed_apps | grep --quiet "^${app}$"; then if ! list_installed_apps | grep --quiet "^${app}$"; then
echo "Error: \"${app}\" is not installed yet" echo "Error: app \"${app}\" is not installed yet"
exit 1 exit 1
fi fi

Loading…
Cancel
Save