PlanktoScope / forklift

Composable, reprovisionable, decentralized management of apps & configs on Raspberry Pis and other embedded Linux systems
Apache License 2.0
6 stars 0 forks source link

updates: Make it easier to bump the local pallet to the latest release or branch commit #246

Closed ethanjli closed 3 weeks ago

ethanjli commented 1 month ago

Currently, in order to bump the local pallet from a release-tagged commit to a newer release tag, either we have to manually mess around with the Git CLI (or some other Git tool) or we have to run the plt switch {pallet path}@{version query} subcommand again with a newer version query. It would be convenient if we could run plt switch @{version query} (with no pallet path) to switch to a different version of the current pallet. If our local pallet is github.com/PlanktoScope/pallet-standard, for example, then we could just run plt switch @stable to stage any available upgrade on the stable release channel (i.e. the stable branch), or plt switch @beta to stage any available upgrade on the beta release channel. And we could just run plt switch @ to stage any available upgrade for the most-recently-used version query; plt upgrade could be an alias for this, though it'd be nice if plt upgrade had a --dry-run option (which might also be nice for plt switch). This would probably involve loading a setting from a config file somewhere (maybe in ~/.config/forklift/pallet-upgrades.yml) about which release channel (i.e. branch) of the pallet the user wants to check for updates from.

This way, a simple scheduled automatic update system could be implemented by just running forklift plt upgrade in a timer. We could also make a system service to run forklift plt fetch whenever we get internet access and/or in a timer - e.g. we can create a file whenever we get internet access or on a daily schedule, and when that file exists then another timer polling the file will run forklift plt check-upgrade && forklift plt upgrade and delete the file. Support for background downloading of upgrades (and all their staging requirements) is covered in #254 rather than this issue.