Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent installer rerun and remove update path #2235

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .githooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,25 @@ warn_githooks() {
echo "$ cp .githooks/* .git/hooks/."
echo "************************************************************"
echo -e "\n"
}

warn_installer() {
echo -e "\n"
echo "************************************************************"
echo "ATTENTION: Installer sources have changed since last pull!"
echo ""
echo "Rerun the installer to apply changes"
echo "$ ./installation/install-jukebox.sh"
echo "************************************************************"
echo -e "\n"
}

# files_changed="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
webapp_changed="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD src/webapp)"
webapp_dep_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD src/webapp/package.json)"
python_req_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD requirements.txt)"
githooks_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD .githooks)"
installer_changed="$(git diff --name-only --no-commit-id ORIG_HEAD HEAD installation)"

if [[ -n $python_req_changed ]]; then
warn_python_requirements
Expand All @@ -80,5 +91,9 @@ if [[ -n $githooks_changed ]]; then
warn_githooks
fi

if [[ -n $installer_changed ]]; then
warn_installer
fi

echo -e "\nTo see a summary of what happened since your last pull, do:"
echo -e "git show --oneline -s ORIG_HEAD..HEAD\n"
echo -e "git show --oneline -s ORIG_HEAD..HEAD\n"
3 changes: 1 addition & 2 deletions documentation/builders/gpio.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Enabling GPIO

The GPIO module needs to be enabled in your main configuration file ``shared/settings/jukebox.yaml``. Look for the
this entry and modify it accordingly:
The GPIO module needs to be enabled in your main configuration file ``shared/settings/jukebox.yaml``. Look for this entry and modify it accordingly:

```yml
gpioz:
Expand Down
30 changes: 5 additions & 25 deletions documentation/builders/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,14 @@

## Updating your Jukebox Version 3

### Update from v3.2.1 and prior
### Update from v3.5.0 and prior

As there are some significant changes in the installation, a new setup on a fresh image is required.
As there are some significant changes in the Jukebox installation, no updates can be performed with the installer.
Please backup your './shared' folder and changed files and run a new installation on a fresh image.
Restore your old files after the new installation was succefull and check if new mandatory settings have been added.
AlvinSchiller marked this conversation as resolved.
Show resolved Hide resolved

### General

Things on Version 3 are moving fast and you may want to keep up with recent changes. Since we are in Alpha Release stage,
a fair number of fixes are expected to be committed in the near future.

You will need to do three things to update your version from develop (or the next release candidate version)

1. Pull the newest code base from Github
2. Check for new entries in the configuration
3. Re-build the WebUI

```bash
# Switch to develop (if desired)
$ git checkout future3/develop

# Get latest code
$ git pull

# Check if new (mandatory) options appeared in jukebox.yaml
# with your favourite diff tool and merge them
``` bash
$ diff shared/settings/jukebox.yaml resources/default-settings/jukebox.default.yaml

$ cd src/webapp
$ ./run_rebuild.sh -u
```

## Migration Path from Version 2
Expand Down
15 changes: 14 additions & 1 deletion installation/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ _check_os_type() {
fi
}

_check_existing_installation() {
if [[ -e "${INSTALLATION_PATH}" ]]; then
print_lc "
############## EXISTING INSTALLATION FOUND ##############
Rerunning the installer over an existing installation is
currently not supported (overwrites settings, etc).
Please backup your 'shared' folder and manually changed
files and run the installation on a fresh image."
exit 1
fi
}

_download_jukebox_source() {
log "#########################################################"
print_c "Downloading Phoniebox software from Github ..."
Expand All @@ -122,7 +134,7 @@ _download_jukebox_source() {
if [[ -z "${GIT_HASH}" ]]; then
exit_on_error "ERROR: Couldn't determine git hash from download."
fi
mv "$git_repo_download" "$GIT_REPO_NAME"
mv "$git_repo_download" "$GIT_REPO_NAME" || exit_on_error "ERROR: Can't overwrite existing installation."
log "\nDONE: Downloading Phoniebox software from Github"
log "#########################################################"
}
Expand All @@ -143,6 +155,7 @@ _setup_logging

### CHECK PREREQUISITE
_check_os_type
_check_existing_installation

### RUN INSTALLATION
log "Current User: $CURRENT_USER"
Expand Down
Loading