diff --git a/doc/cli.markdown b/doc/cli.markdown index 33336e7b..f825eeb6 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1464,13 +1464,17 @@ Path to a local YAML or JSON file containing Docker registry passwords used to p Note this feature is in beta. -Start a live session with the containers pushed to a local-mode device. +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. +#### --detached, -d + +Don't tail application logs when pushing to a local mode device + # Settings ## settings diff --git a/lib/actions/push.ts b/lib/actions/push.ts index 5c71e963..c124a513 100644 --- a/lib/actions/push.ts +++ b/lib/actions/push.ts @@ -107,6 +107,7 @@ export const push: CommandDefinition< nocache: boolean; 'registry-secrets': string; live: boolean; + detached: boolean; } > = { signature: 'push ', @@ -184,13 +185,19 @@ export const push: CommandDefinition< description: stripIndent` Note this feature is in beta. - Start a live session with the containers pushed to a local-mode device. + 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.`, }, + { + signature: 'detached', + alias: 'd', + description: `Don't tail application logs when pushing to a local mode device`, + boolean: true, + }, ], async action(params, options, done) { const sdk = (await import('balena-sdk')).fromSharedOptions(); @@ -230,7 +237,12 @@ export const push: CommandDefinition< // Ensure that the live argument has not been passed to a cloud build if (options.live) { exitWithExpectedError( - 'The --live flag is only valid when pushing to a local device.', + 'The --live flag is only valid when pushing to a local mode device', + ); + } + if (options.detached) { + exitWithExpectedError( + `The --detached flag is only valid when pushing to a local mode device.`, ); } @@ -272,6 +284,7 @@ export const push: CommandDefinition< registrySecrets, nocache: options.nocache || false, live: options.live || false, + detached: options.detached || false, }), ) .catch(BuildError, e => { diff --git a/lib/utils/device/deploy.ts b/lib/utils/device/deploy.ts index ac6e6878..d97a39eb 100644 --- a/lib/utils/device/deploy.ts +++ b/lib/utils/device/deploy.ts @@ -47,6 +47,7 @@ export interface DeviceDeployOptions { registrySecrets: RegistrySecrets; nocache: boolean; live: boolean; + detached: boolean; } async function checkSource(source: string): Promise { @@ -146,6 +147,9 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise { await api.setTargetState(targetState); + if (opts.detached) { + return; + } // Print an empty newline to separate the build output // from the device output console.log();