Browse Source

Move OTA update logic to scripts/update (#66)

partition-refactor
Mayank Chhabra 5 years ago
committed by GitHub
parent
commit
0277601d17
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      bin/.gitkeep
  2. 2
      events/triggers/update
  3. 0
      scripts/update/.updateignore
  4. 2
      scripts/update/00-run.sh
  5. 2
      scripts/update/01-run.sh
  6. 0
      scripts/update/02-run.sh
  7. 0
      scripts/update/03-run.sh
  8. 8
      scripts/update/README.md

0
bin/.gitkeep

2
events/triggers/update

@ -49,7 +49,7 @@ wget -qO- "https://raw.githubusercontent.com/getumbrel/umbrel/$RELEASE/install-b
# Run update scripts
echo "Running update install scripts of the new release"
cd bin/update
cd scripts/update
UPDATE_INSTALL_SCRIPTS=$(ls *-run.sh)
for script in $UPDATE_INSTALL_SCRIPTS; do
if [[ -x $script ]]; then

0
bin/update/.updateignore → scripts/update/.updateignore

2
bin/update/00-run.sh → scripts/update/00-run.sh

@ -34,7 +34,7 @@ chown -R 1000:1000 "$UMBREL_ROOT"/
echo "Backing up existing directory tree"
rsync -av "$UMBREL_ROOT"/ \
--exclude-from="$UMBREL_ROOT/.umbrel-$RELEASE/bin/update/.updateignore" \
--exclude-from="$UMBREL_ROOT/.umbrel-$RELEASE/scripts/update/.updateignore" \
"$UMBREL_ROOT"/.umbrel-backup/
echo "Successfully backed up to $UMBREL_ROOT/.umbrel-backup"

2
bin/update/01-run.sh → scripts/update/01-run.sh

@ -68,7 +68,7 @@ cd "$UMBREL_ROOT"
# Overlay home dir structure with new dir tree
echo "Overlaying $UMBREL_ROOT/ with new directory tree"
rsync -av "$UMBREL_ROOT"/.umbrel-"$RELEASE"/ \
--exclude-from="$UMBREL_ROOT/.umbrel-$RELEASE/bin/update/.updateignore" \
--exclude-from="$UMBREL_ROOT/.umbrel-$RELEASE/scripts/update/.updateignore" \
"$UMBREL_ROOT"/
# Fix permissions

0
bin/update/02-run.sh → scripts/update/02-run.sh

0
bin/update/03-run.sh → scripts/update/03-run.sh

8
bin/update/README.md → scripts/update/README.md

@ -54,10 +54,10 @@ How over-the-air updates work on Umbrel.
16. `$UMBREL_ROOT/events/triggers/update` then executes all of the following update scripts from the new release `$UMBREL_ROOT/.umbrel-vX.Y.Z` one-by-one:
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/bin/update/00-run.sh`](https://github.com/getumbrel/umbrel/blob/master/bin/update/00-run.sh): Pre-update preparation script (does things like making a backup)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/bin/update/01-run.sh`](https://github.com/getumbrel/umbrel/blob/master/bin/update/01-run.sh): Install update script (installs the update)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/bin/update/02-run.sh`](https://github.com/getumbrel/umbrel/blob/master/bin/update/02-run.sh): Post-update script (used to run unit-tests to make sure the update was successfully installed)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/bin/update/03-run.sh`](https://github.com/getumbrel/umbrel/blob/master/bin/update/03-run.sh): Success script (runs after the updated has been successfully downloaded and installed)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/scripts/update/00-run.sh`](https://github.com/getumbrel/umbrel/blob/master/scripts/update/00-run.sh): Pre-update preparation script (does things like making a backup)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/scripts/update/01-run.sh`](https://github.com/getumbrel/umbrel/blob/master/scripts/update/01-run.sh): Install update script (installs the update)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/scripts/update/02-run.sh`](https://github.com/getumbrel/umbrel/blob/master/scripts/update/02-run.sh): Post-update script (used to run unit-tests to make sure the update was successfully installed)
- [`$UMBREL_ROOT/.umbrel-vX.Y.Z/scripts/update/03-run.sh`](https://github.com/getumbrel/umbrel/blob/master/scripts/update/03-run.sh): Success script (runs after the updated has been successfully downloaded and installed)
All of the above scripts continuously update `$UMBREL_ROOT/statuses/update-status.json` with the progress of update, which the dashboard periodically fetches every 2s via `umbrel-manager` to keep the user updated.
Loading…
Cancel
Save