mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 13:47:52 +00:00
Merge pull request #1190 from balena-io/push-logs-.local
Allow specifying a .local address for logs and push
This commit is contained in:
commit
a9aa7538f3
@ -861,9 +861,9 @@ By default, the command prints all log messages and exits.
|
|||||||
|
|
||||||
To continuously stream output, and see new logs in real time, use the `--tail` option.
|
To continuously stream output, and see new logs in real time, use the `--tail` option.
|
||||||
|
|
||||||
If an IP address is passed to this command, logs are displayed from
|
If an IP or .local address is passed to this command, logs are displayed from
|
||||||
a local mode device with that address. Note that --tail is implied
|
a local mode device with that address. Note that --tail is implied
|
||||||
when this command is provided an IP address.
|
when this command is provided a local mode device.
|
||||||
|
|
||||||
Logs from a single service can be displayed with the --service flag. Just system logs
|
Logs from a single service can be displayed with the --service flag. Just system logs
|
||||||
can be shown with the --system flag. Note that these flags can be used together.
|
can be shown with the --system flag. Note that these flags can be used together.
|
||||||
@ -872,12 +872,12 @@ Examples:
|
|||||||
|
|
||||||
$ balena logs 23c73a1
|
$ balena logs 23c73a1
|
||||||
$ balena logs 23c73a1 --tail
|
$ balena logs 23c73a1 --tail
|
||||||
$ balena logs 23c73a1 --service my-service
|
|
||||||
|
|
||||||
$ balena logs 192.168.0.31
|
$ balena logs 192.168.0.31
|
||||||
$ balena logs 192.168.0.31 --service my-service
|
$ balena logs 192.168.0.31 --service my-service
|
||||||
$ balena logs 192.168.0.31 --system
|
|
||||||
$ balena logs 192.168.0.31 --system --service my-service
|
$ balena logs 23c73a1.local --system
|
||||||
|
$ balena logs 23c73a1.local --system --service my-service
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
@ -1454,10 +1454,10 @@ Examples:
|
|||||||
|
|
||||||
$ balena push 10.0.0.1
|
$ balena push 10.0.0.1
|
||||||
$ balena push 10.0.0.1 --source <source directory>
|
$ balena push 10.0.0.1 --source <source directory>
|
||||||
$ balena push 10.0.0.1 -s <source directory>
|
|
||||||
$ balena push 10.0.0.1 --service my-service
|
$ balena push 10.0.0.1 --service my-service
|
||||||
$ balena push 10.0.0.1 --system
|
|
||||||
$ balena push 10.0.0.1 --system --service my-service
|
$ balena push 23c73a1.local --system
|
||||||
|
$ balena push 23c73a1.local --system --service my-service
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import { CommandDefinition } from 'capitano';
|
|||||||
import { stripIndent } from 'common-tags';
|
import { stripIndent } from 'common-tags';
|
||||||
|
|
||||||
import { normalizeUuidProp } from '../utils/normalization';
|
import { normalizeUuidProp } from '../utils/normalization';
|
||||||
|
import { validateDotLocalUrl } from '../utils/validation';
|
||||||
|
|
||||||
type CloudLog =
|
type CloudLog =
|
||||||
| {
|
| {
|
||||||
@ -51,9 +52,9 @@ export const logs: CommandDefinition<
|
|||||||
|
|
||||||
To continuously stream output, and see new logs in real time, use the \`--tail\` option.
|
To continuously stream output, and see new logs in real time, use the \`--tail\` option.
|
||||||
|
|
||||||
If an IP address is passed to this command, logs are displayed from
|
If an IP or .local address is passed to this command, logs are displayed from
|
||||||
a local mode device with that address. Note that --tail is implied
|
a local mode device with that address. Note that --tail is implied
|
||||||
when this command is provided an IP address.
|
when this command is provided a local mode device.
|
||||||
|
|
||||||
Logs from a single service can be displayed with the --service flag. Just system logs
|
Logs from a single service can be displayed with the --service flag. Just system logs
|
||||||
can be shown with the --system flag. Note that these flags can be used together.
|
can be shown with the --system flag. Note that these flags can be used together.
|
||||||
@ -62,12 +63,12 @@ export const logs: CommandDefinition<
|
|||||||
|
|
||||||
$ balena logs 23c73a1
|
$ balena logs 23c73a1
|
||||||
$ balena logs 23c73a1 --tail
|
$ balena logs 23c73a1 --tail
|
||||||
$ balena logs 23c73a1 --service my-service
|
|
||||||
|
|
||||||
$ balena logs 192.168.0.31
|
$ balena logs 192.168.0.31
|
||||||
$ balena logs 192.168.0.31 --service my-service
|
$ balena logs 192.168.0.31 --service my-service
|
||||||
$ balena logs 192.168.0.31 --system
|
|
||||||
$ balena logs 192.168.0.31 --system --service my-service`,
|
$ balena logs 23c73a1.local --system
|
||||||
|
$ balena logs 23c73a1.local --system --service my-service`,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
signature: 'tail',
|
signature: 'tail',
|
||||||
@ -127,7 +128,10 @@ export const logs: CommandDefinition<
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (validateIPAddress(params.uuidOrDevice)) {
|
if (
|
||||||
|
validateIPAddress(params.uuidOrDevice) ||
|
||||||
|
validateDotLocalUrl(params.uuidOrDevice)
|
||||||
|
) {
|
||||||
const { DeviceAPI } = await import('../utils/device/api');
|
const { DeviceAPI } = await import('../utils/device/api');
|
||||||
const deviceApi = new DeviceAPI(logger, params.uuidOrDevice);
|
const deviceApi = new DeviceAPI(logger, params.uuidOrDevice);
|
||||||
logger.logDebug('Checking we can access device');
|
logger.logDebug('Checking we can access device');
|
||||||
|
@ -21,6 +21,7 @@ import { stripIndent } from 'common-tags';
|
|||||||
import { registrySecretsHelp } from '../utils/messages';
|
import { registrySecretsHelp } from '../utils/messages';
|
||||||
import {
|
import {
|
||||||
validateApplicationName,
|
validateApplicationName,
|
||||||
|
validateDotLocalUrl,
|
||||||
validateIPAddress,
|
validateIPAddress,
|
||||||
} from '../utils/validation';
|
} from '../utils/validation';
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ function getBuildTarget(appOrDevice: string): BuildTarget | null {
|
|||||||
return BuildTarget.Cloud;
|
return BuildTarget.Cloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateIPAddress(appOrDevice)) {
|
if (validateIPAddress(appOrDevice) || validateDotLocalUrl(appOrDevice)) {
|
||||||
return BuildTarget.Device;
|
return BuildTarget.Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,10 +149,10 @@ export const push: CommandDefinition<
|
|||||||
|
|
||||||
$ balena push 10.0.0.1
|
$ balena push 10.0.0.1
|
||||||
$ balena push 10.0.0.1 --source <source directory>
|
$ balena push 10.0.0.1 --source <source directory>
|
||||||
$ balena push 10.0.0.1 -s <source directory>
|
|
||||||
$ balena push 10.0.0.1 --service my-service
|
$ balena push 10.0.0.1 --service my-service
|
||||||
$ balena push 10.0.0.1 --system
|
|
||||||
$ balena push 10.0.0.1 --system --service my-service
|
$ balena push 23c73a1.local --system
|
||||||
|
$ balena push 23c73a1.local --system --service my-service
|
||||||
`,
|
`,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user