mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-21 09:51:58 +00:00
v12 preparations: Add feature switch for build/deploy --logs
option
Connects-to: #1770 Change-type: patch
This commit is contained in:
parent
21dd959344
commit
626d328194
@ -50,9 +50,21 @@ export function appendOptions(opts) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
signature: 'logs',
|
signature: 'logs',
|
||||||
description: 'Display full log output',
|
description: isV12()
|
||||||
|
? 'No-op and deprecated since balena CLI v12.0.0. Build logs are now shown by default.'
|
||||||
|
: 'Display full log output',
|
||||||
boolean: true,
|
boolean: true,
|
||||||
},
|
},
|
||||||
|
...(isV12()
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
signature: 'nologs',
|
||||||
|
description:
|
||||||
|
'Hide the image build log output (produce less verbose output)',
|
||||||
|
boolean: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
signature: 'nogitignore',
|
signature: 'nogitignore',
|
||||||
description: isV12()
|
description: isV12()
|
||||||
@ -98,7 +110,7 @@ export function generateOpts(options) {
|
|||||||
return fs.realpath(options.source || '.').then(projectPath => ({
|
return fs.realpath(options.source || '.').then(projectPath => ({
|
||||||
projectName: options.projectName,
|
projectName: options.projectName,
|
||||||
projectPath,
|
projectPath,
|
||||||
inlineLogs: !!options.logs,
|
inlineLogs: !options.nologs && (!!options.logs || isV12()),
|
||||||
dockerfilePath: options.dockerfile,
|
dockerfilePath: options.dockerfile,
|
||||||
nogitignore: !!options.nogitignore || isV12(),
|
nogitignore: !!options.nogitignore || isV12(),
|
||||||
noParentCheck: options['noparent-check'],
|
noParentCheck: options['noparent-check'],
|
||||||
|
@ -24,6 +24,7 @@ import mock = require('mock-require');
|
|||||||
import { fs } from 'mz';
|
import { fs } from 'mz';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
|
import { isV12 } from '../../build/utils/version';
|
||||||
import { BalenaAPIMock } from '../balena-api-mock';
|
import { BalenaAPIMock } from '../balena-api-mock';
|
||||||
import { expectStreamNoCRLF, testDockerBuildStream } from '../docker-build';
|
import { expectStreamNoCRLF, testDockerBuildStream } from '../docker-build';
|
||||||
import { DockerMock, dockerResponsePath } from '../docker-mock';
|
import { DockerMock, dockerResponsePath } from '../docker-mock';
|
||||||
@ -98,7 +99,9 @@ describe('balena build', function() {
|
|||||||
...commonResponseLines[responseFilename],
|
...commonResponseLines[responseFilename],
|
||||||
`[Info] No "docker-compose.yml" file found at "${projectPath}"`,
|
`[Info] No "docker-compose.yml" file found at "${projectPath}"`,
|
||||||
`[Info] Creating default composition with source: "${projectPath}"`,
|
`[Info] Creating default composition with source: "${projectPath}"`,
|
||||||
'[Build] main Image size: 1.14 MB',
|
isV12()
|
||||||
|
? '[Build] main Step 1/4 : FROM busybox'
|
||||||
|
: '[Build] main Image size: 1.14 MB',
|
||||||
];
|
];
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
expectedResponseLines.push(
|
expectedResponseLines.push(
|
||||||
@ -153,7 +156,9 @@ describe('balena build', function() {
|
|||||||
`[Info] Creating default composition with source: "${projectPath}"`,
|
`[Info] Creating default composition with source: "${projectPath}"`,
|
||||||
'[Info] Building for rpi/raspberry-pi',
|
'[Info] Building for rpi/raspberry-pi',
|
||||||
'[Info] Emulation is enabled',
|
'[Info] Emulation is enabled',
|
||||||
'[Build] main Image size: 1.14 MB',
|
isV12()
|
||||||
|
? '[Build] main Step 1/4 : FROM busybox'
|
||||||
|
: '[Build] main Image size: 1.14 MB',
|
||||||
'[Success] Build succeeded!',
|
'[Success] Build succeeded!',
|
||||||
];
|
];
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
@ -223,7 +228,9 @@ describe('balena build', function() {
|
|||||||
...commonResponseLines[responseFilename],
|
...commonResponseLines[responseFilename],
|
||||||
`[Info] No "docker-compose.yml" file found at "${projectPath}"`,
|
`[Info] No "docker-compose.yml" file found at "${projectPath}"`,
|
||||||
`[Info] Creating default composition with source: "${projectPath}"`,
|
`[Info] Creating default composition with source: "${projectPath}"`,
|
||||||
'[Build] main Image size: 1.14 MB',
|
isV12()
|
||||||
|
? '[Build] main Step 1/4 : FROM busybox'
|
||||||
|
: '[Build] main Image size: 1.14 MB',
|
||||||
];
|
];
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
expectedResponseLines.push(
|
expectedResponseLines.push(
|
||||||
@ -293,8 +300,15 @@ describe('balena build', function() {
|
|||||||
};
|
};
|
||||||
const expectedResponseLines: string[] = [
|
const expectedResponseLines: string[] = [
|
||||||
...commonResponseLines[responseFilename],
|
...commonResponseLines[responseFilename],
|
||||||
`[Build] service1 Image size: 1.14 MB`,
|
...(isV12()
|
||||||
`[Build] service2 Image size: 1.14 MB`,
|
? [
|
||||||
|
'[Build] service1 Step 1/4 : FROM busybox',
|
||||||
|
'[Build] service2 Step 1/4 : FROM busybox',
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
`[Build] service1 Image size: 1.14 MB`,
|
||||||
|
`[Build] service2 Image size: 1.14 MB`,
|
||||||
|
]),
|
||||||
];
|
];
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
expectedResponseLines.push(
|
expectedResponseLines.push(
|
||||||
|
@ -23,6 +23,7 @@ import { fs } from 'mz';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
|
|
||||||
|
import { isV12 } from '../../build/utils/version';
|
||||||
import { BalenaAPIMock } from '../balena-api-mock';
|
import { BalenaAPIMock } from '../balena-api-mock';
|
||||||
import { testDockerBuildStream } from '../docker-build';
|
import { testDockerBuildStream } from '../docker-build';
|
||||||
import { DockerMock, dockerResponsePath } from '../docker-mock';
|
import { DockerMock, dockerResponsePath } from '../docker-mock';
|
||||||
@ -38,7 +39,9 @@ const commonResponseLines = {
|
|||||||
'[Info] Docker Desktop detected (daemon architecture: "x86_64")',
|
'[Info] Docker Desktop detected (daemon architecture: "x86_64")',
|
||||||
'[Info] Docker itself will determine and enable architecture emulation if required,',
|
'[Info] Docker itself will determine and enable architecture emulation if required,',
|
||||||
'[Info] without balena-cli intervention and regardless of the --emulated option.',
|
'[Info] without balena-cli intervention and regardless of the --emulated option.',
|
||||||
'[Build] main Image size: 1.14 MB',
|
isV12()
|
||||||
|
? '[Build] main Step 1/4 : FROM busybox'
|
||||||
|
: '[Build] main Image size: 1.14 MB',
|
||||||
'[Info] Creating release...',
|
'[Info] Creating release...',
|
||||||
'[Info] Pushing images to registry...',
|
'[Info] Pushing images to registry...',
|
||||||
'[Info] Saving release...',
|
'[Info] Saving release...',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user