Upgrade Handler

The upgrade handler is responsible for executing upgrades - which typically means running some shell command. Multiple upgrade targets can be defined; each with its own command.

The “complete” feature involves making a record of each upgrade occurrence in the app database, as well as capturing the STDOUT/STDERR streams to file for later review.

For the default (i.e. local app) upgrade target, output of pip freeze is also captured before and after the upgrade runs. This allows viewing a package diff e.g. in the web app.

The base class and default upgrade handler is wuttjamaican.upgrades.UpgradeHandler.

The app handler is responsible for creating the upgrade handler via get_upgrade_handler():

app = config.get_app()
handler = app.get_upgrade_handler()