diff --git a/doc/cli.markdown b/doc/cli.markdown index f527c116..004fc2c3 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1390,18 +1390,23 @@ Docker host TLS key file ## push <applicationOrDevice> -This command can be used to start an image build on the remote balenaCloud build -servers, or on a local-mode balena device. +This command can be used to start a build on the remote balena cloud builders, +or a local mode balena device. When building on the balenaCloud servers, the given source directory will be sent to the remote server. This can be used as a drop-in replacement for the "git push" deployment method. -When building on a local-mode device, the given source directory will be +When building on a local mode device, the given source directory will be built on the device, and the resulting containers will be run on the device. Logs will be streamed back from the device as part of the same invocation. The web dashboard can be used to switch a device to local mode: https://www.balena.io/docs/learn/develop/local-mode/ +Note that local mode requires a supervisor version of at least v7.21.0. + +It is also possible to run a push to a local mode device in live mode. +This will watch for changes in the source directory and perform an +in-place build in the running containers [BETA]. The --registry-secrets option specifies a JSON or YAML file containing private Docker registry usernames and passwords to be used when pulling base images. @@ -1447,8 +1452,14 @@ Path to a local YAML or JSON file containing Docker registry passwords used to p #### --live, -l -Start a live session after the push, which will wait for code changes, and synchronise them with -running containers. This mode is only valid when pushing to a local device. +Note this feature is in beta. + +Start a live session with the containers pushed to a local-mode device. +The project source folder is watched for filesystem events, and changes +to files and folders are automatically synchronized to the running +containers. The synchronisation is only in one direction, from this machine to +the device, and changes made on the device itself may be overwritten. +This feature requires a device running supervisor version v9.7.0 or greater. # Settings diff --git a/lib/actions/push.ts b/lib/actions/push.ts index 3caca6d8..8701a59f 100644 --- a/lib/actions/push.ts +++ b/lib/actions/push.ts @@ -117,24 +117,20 @@ export const push: CommandDefinition< This command can be used to start a build on the remote balena cloud builders, or a local mode balena device. - When building on the balena cloud the given source directory will be sent to the - balena builder, and the build will proceed. This can be used as a drop-in - replacement for git push to deploy. - - When building on a local mode device, the given source directory will be built - on the device, and the resulting containers will be run on the device. Logs will - be streamed back from the device as part of the same invocation. This requires - a device with a supervisor version of at least v7.21.0. - When building on the balenaCloud servers, the given source directory will be sent to the remote server. This can be used as a drop-in replacement for the "git push" deployment method. - When building on a local-mode device, the given source directory will be + When building on a local mode device, the given source directory will be built on the device, and the resulting containers will be run on the device. Logs will be streamed back from the device as part of the same invocation. The web dashboard can be used to switch a device to local mode: https://www.balena.io/docs/learn/develop/local-mode/ + Note that local mode requires a supervisor version of at least v7.21.0. + + It is also possible to run a push to a local mode device in live mode. + This will watch for changes in the source directory and perform an + in-place build in the running containers [BETA]. ${registrySecretsHelp.split('\n').join('\n\t\t')} @@ -180,8 +176,14 @@ export const push: CommandDefinition< alias: 'l', boolean: true, description: stripIndent` - Start a live session after the push, which will wait for code changes, and synchronise them with - running containers. This mode is only valid when pushing to a local device.`, + Note this feature is in beta. + + Start a live session with the containers pushed to a local-mode device. + The project source folder is watched for filesystem events, and changes + to files and folders are automatically synchronized to the running + containers. The synchronisation is only in one direction, from this machine to + the device, and changes made on the device itself may be overwritten. + This feature requires a device running supervisor version v9.7.0 or greater.`, }, ], async action(params, options, done) { diff --git a/lib/utils/device/deploy.ts b/lib/utils/device/deploy.ts index da6b1f6c..708bdea2 100644 --- a/lib/utils/device/deploy.ts +++ b/lib/utils/device/deploy.ts @@ -88,12 +88,9 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise { if (!semver.satisfies(version, '>=7.21.4')) { exitWithExpectedError(versionError); } - // FIXME: DO NOT MERGE until this version number has been updated - // with the version which the following PR ends up in the supervisor - // https://github.com/balena-io/balena-supervisor/pull/828 - if (opts.live && !semver.satisfies(version, '>=1.0.0')) { + if (opts.live && !semver.satisfies(version, '>=9.7.0')) { exitWithExpectedError( - new Error('Using livepush requires a supervisor >= v1.0.0'), + new Error('Using livepush requires a supervisor >= v9.7.0'), ); } } catch { diff --git a/lib/utils/device/live.ts b/lib/utils/device/live.ts index 0eeb07d6..00f1f2ca 100644 --- a/lib/utils/device/live.ts +++ b/lib/utils/device/live.ts @@ -245,7 +245,6 @@ export class LivepushManager { } private async handleFSEvent(fsEvent: ContextEvent): Promise { - // TODO: If there's a dockerfile event, we must perform a rebuild this.logger.logDebug( `Got a filesystem event for service: ${ fsEvent.serviceName