Skip to content

Add auto-update feature #71

@taylortom

Description

@taylortom

Feature description

Add a feature to allow the app to automatically update content plugins with no user/admin input at a configurable interval.

Add extra config settings:

  • autoUpdate (Boolean, default: false): will enable/disable the feature
  • updateCron (string, default @daily or 0 0 * * *): should be in a standard CRON format, and will specify how often to run the update check
  • semverSpecifier (string, default: ^, enum: ['~', '^', '*']): will clamp which versions will be installed automatically according to the npm semver ranges: * for major/all updates, ^ for minor updates (i.e. 1.x.x), and ~ for patch updates (i.e. 1.0.x)

Add update check function

Function should look something like:

/**]
 * @param {string|Array<string>} pluginName The name (or array of names) for the plugins to check
 * @return {Object|Array<Object>} Result(s) from getPluginInfos
 */
checkForPluginUpdate (plugin_name) {
}

Add CRON automated task

Set up automated update checker to run at the interval specified by updateCron, and use new checkForPluginUpdate function to check all installed plugins (with isLocalInstall: false property).

For plugins with updates found, installPlugin should be called, passing plugin name and the version to install.

Logging

  • checkForPluginUpdate:
    • Log one message at the beginning of the check: this.log('verbose', 'UPDATE', 'checking for updates for ${pluginName}')
    • Log message at the end of the function to summarise: this.log('info', 'UPDATE', 'update found for ${pluginName} (${updateVersion})') or this.log('verbose', 'UPDATE', 'no updates found for ${pluginName}')
  • installPlugin:
    • Add log at beginning of the function this.log('debug', 'INSTALL', 'installing ${pluginName}@${version}')
    • Add log at end of the function this.log('info', 'INSTALL', 'installed ${pluginName}@${version}')

Can you work on this feature?

  • I can contribute

Metadata

Metadata

Labels

enhancementNew or additional functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions