mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-06-24 18:45:07 +00:00
Compare commits
43 Commits
custom-doc
...
v13.10.1
Author | SHA1 | Date | |
---|---|---|---|
26aae0afab | |||
5f3cf75c1a | |||
73c487c2f5 | |||
264cd94be5 | |||
2664f4e7fb | |||
3ce2653881 | |||
719860366f | |||
21ded85c7a | |||
c91f67d27e | |||
18eedfec7f | |||
1fe0480a8a | |||
c7f56d92dd | |||
a92f58134f | |||
cc6a8ef76e | |||
88f4a3d88e | |||
f6d668684a | |||
be7c0dc897 | |||
566b7f97e0 | |||
f55dd81a19 | |||
dba5349390 | |||
6a8dfcc664 | |||
59e35d866f | |||
9235c928f1 | |||
3d88f0144a | |||
a6b461ba91 | |||
b96da951db | |||
8235cead07 | |||
30b9d9141d | |||
03b41d9989 | |||
aab3af2153 | |||
600457de61 | |||
17db857e10 | |||
eb45ae2a30 | |||
2eaf70bff3 | |||
226f45f732 | |||
c4990f3a26 | |||
0195a3b18c | |||
3d90aeb122 | |||
0571039bfe | |||
ee668a4c5c | |||
ead4dbfab1 | |||
0b498d09df | |||
2b2c40c22d |
File diff suppressed because it is too large
Load Diff
309
CHANGELOG.md
309
CHANGELOG.md
@ -4,6 +4,315 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 13.10.1 - 2022-08-01
|
||||
|
||||
* Fix balena deploy missing dependency error [Thodoris Greasidis]
|
||||
|
||||
## 13.10.0 - 2022-07-20
|
||||
|
||||
* Add `--view` flag to `device` command for opening a device's dashboard page [Matthew Yarmolinsky]
|
||||
|
||||
## 13.9.0 - 2022-07-19
|
||||
|
||||
* Switch to balena-compose [Akis Kesoglou]
|
||||
|
||||
## 13.8.0 - 2022-07-18
|
||||
|
||||
* Add `--note` option for `push` and `deploy` [Matthew Yarmolinsky]
|
||||
|
||||
## 13.7.1 - 2022-07-13
|
||||
|
||||
* os download: Fix resolving to draft releases [Thodoris Greasidis]
|
||||
|
||||
## 13.7.0 - 2022-07-07
|
||||
|
||||
* Add `--view` flag to `fleet` command for opening a fleet's dashboard page [Matthew Yarmolinsky]
|
||||
|
||||
## 13.6.1 - 2022-06-09
|
||||
|
||||
|
||||
<details>
|
||||
<summary> Update balena-sdk to use the native OS release phase & variant fields [Thodoris Greasidis] </summary>
|
||||
|
||||
> ### balena-sdk-16.22.0 - 2022-06-06
|
||||
>
|
||||
> * os: Start using the release.phase field in the available versions [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.21.1 - 2022-06-02
|
||||
>
|
||||
> * Add provisioning key expiry date to generateDeviceProvisioningKey [Nitish Agarwal]
|
||||
>
|
||||
> ### balena-sdk-16.21.0 - 2022-06-01
|
||||
>
|
||||
> * os: Refactor the computation of OS releases [Thodoris Greasidis]
|
||||
> * os: Use the model's release variant when the native fields are used [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.20.6 - 2022-06-01
|
||||
>
|
||||
> * Deprecate the needsPasswordReset field of the JWTUser [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.20.5 - 2022-05-25
|
||||
>
|
||||
> * Update TypeScript to v4.7 [Thodoris Greasidis]
|
||||
>
|
||||
</details>
|
||||
|
||||
## 13.6.0 - 2022-06-06
|
||||
|
||||
* Update QEMU to v7.0.0 [Kyle Harding]
|
||||
|
||||
## 13.5.3 - 2022-05-31
|
||||
|
||||
* Drop the needsPasswordReset property from the tests [Thodoris Greasidis]
|
||||
|
||||
## 13.5.2 - 2022-05-31
|
||||
|
||||
* Deduplicate npm-shrinkwrap.json [Thodoris Greasidis]
|
||||
|
||||
## 13.5.1 - 2022-05-26
|
||||
|
||||
* preload: Fix issue where balenaOS v2.98.3+ required an Internet connection to start apps [pipex]
|
||||
|
||||
## 13.5.0 - 2022-05-24
|
||||
|
||||
|
||||
<details>
|
||||
<summary> Update balena-sdk to 16.20.4 [Nitish Agarwal] </summary>
|
||||
|
||||
> ### balena-sdk-16.20.4 - 2022-05-09
|
||||
>
|
||||
> * bump @types/node from 10.17.60 to 12.20.500 [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.20.3 - 2022-05-06
|
||||
>
|
||||
> * patch: bump browserify from 14.5.0 to 17.0.0 [dependabot[bot]]
|
||||
>
|
||||
> ### balena-sdk-16.20.2 - 2022-05-05
|
||||
>
|
||||
> * patch: bump tmp from 0.0.31 to 0.2.1 [dependabot[bot]]
|
||||
>
|
||||
> ### balena-sdk-16.20.1 - 2022-05-05
|
||||
>
|
||||
> * Drop the non-populated apiUrl & actionsUrl properties from Config type [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.20.0 - 2022-05-04
|
||||
>
|
||||
> * models.apiKey: Update apiKeyInfo with expiryDate option [Nitish Agarwal]
|
||||
> * os.getConfig: Add typings for the provisioningKeyExpiryDate option [Balena CI]
|
||||
>
|
||||
> ### balena-sdk-16.19.14 - 2022-05-04
|
||||
>
|
||||
> * config.getAll: Mark the deviceTypes property as optional [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.13 - 2022-05-03
|
||||
>
|
||||
> * patch: bump mocha from 3.5.3 to 10.0.0 [dependabot[bot]]
|
||||
>
|
||||
> ### balena-sdk-16.19.12 - 2022-05-03
|
||||
>
|
||||
> * config.getAll: Deprecate the pubnub property and mark as optional [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.11 - 2022-05-03
|
||||
>
|
||||
> * patch: bump mockttp from 0.9.1 to 2.7.0 [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.10 - 2022-04-27
|
||||
>
|
||||
> * Reduce the prod typing dependencies [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.9 - 2022-04-26
|
||||
>
|
||||
> * patch: Remove documentation.md from the NPM package [Vipul Gupta]
|
||||
>
|
||||
> ### balena-sdk-16.19.8 - 2022-04-20
|
||||
>
|
||||
> * patch: Remove additional quotes [Vipul Gupta (@vipulgupta2048)]
|
||||
>
|
||||
> ### balena-sdk-16.19.7 - 2022-04-12
|
||||
>
|
||||
> * tests: Update to work with latest major of superagent [Thodoris Greasidis]
|
||||
> * patch: bump superagent from 3.8.3 to 7.1.2 [dependabot[bot]]
|
||||
>
|
||||
> ### balena-sdk-16.19.6 - 2022-04-11
|
||||
>
|
||||
> * patch: bump dotenv from 4.0.0 to 16.0.0 [dependabot[bot]]
|
||||
>
|
||||
> ### balena-sdk-16.19.5 - 2022-04-09
|
||||
>
|
||||
> * Bump karma to v6 [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.4 - 2022-04-09
|
||||
>
|
||||
> * Add dependabot configuration [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.3 - 2022-04-06
|
||||
>
|
||||
> * tests: Update v5 model endpoint prefix references [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.19.2 - 2022-04-06
|
||||
>
|
||||
>
|
||||
> <details>
|
||||
> <summary> Fix extracting a meaningful error message instead of "[object Object]" [Thodoris Greasidis] </summary>
|
||||
>
|
||||
>> #### balena-request-11.5.5 - 2022-04-06
|
||||
>>
|
||||
>> * Fix extracting the response error from object response bodies [Thodoris Greasidis]
|
||||
>>
|
||||
>> #### balena-request-11.5.4 - 2022-04-06
|
||||
>>
|
||||
>> * Drop explicit karma-chrome-launcher devDependency [Thodoris Greasidis]
|
||||
>>
|
||||
> </details>
|
||||
>
|
||||
>
|
||||
> ### balena-sdk-16.19.1 - 2022-04-05
|
||||
>
|
||||
> * Update balena-request dependency to v11.5.3 [Matthew Yarmolinsky]
|
||||
>
|
||||
> ### balena-sdk-16.19.0 - 2022-03-16
|
||||
>
|
||||
> * Add release.setKnownIssueList function for setting a release's known issue list [Matthew Yarmolinsky]
|
||||
>
|
||||
> ### balena-sdk-16.18.0 - 2022-03-14
|
||||
>
|
||||
> * minor: Add trying SDK in the browser [Vipul Gupta (@vipulgupta2048)]
|
||||
>
|
||||
> ### balena-sdk-16.17.0 - 2022-03-11
|
||||
>
|
||||
> * device.getWithServiceDetails: Add the release id in the service info [Matthew Yarmolinsky]
|
||||
>
|
||||
> ### balena-sdk-16.16.1 - 2022-03-08
|
||||
>
|
||||
> * Replace internal use of deprecated OsVersion.rawVersion with raw_version [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.16.0 - 2022-03-03
|
||||
>
|
||||
> * Add support for named imports from .mjs files [Thodoris Greasidis]
|
||||
> * Update npx command to fix ts-compatibility tests [Thodoris Greasidis]
|
||||
> * Regenerate Documentation [Thodoris Greasidis]
|
||||
> * Update typescript to 4.6.2 [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.15.1 - 2022-02-24
|
||||
>
|
||||
> * Remove unnecessary vpn address filtering when fetching local addresses [Pagan Gazzard]
|
||||
>
|
||||
> ### balena-sdk-16.15.0 - 2022-02-16
|
||||
>
|
||||
> * Add applicationClass parameter to application create function for setting is_of__class property [Matthew Yarmolinsky]
|
||||
>
|
||||
> ### balena-sdk-16.14.0 - 2022-02-15
|
||||
>
|
||||
> * Add name and description field to generateDeviceKey for device. [Nitish Agarwal]
|
||||
>
|
||||
> ### balena-sdk-16.13.4 - 2022-01-27
|
||||
>
|
||||
> * typings: Fix conditional $or/$and/$not $filters [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.13.3 - 2022-01-27
|
||||
>
|
||||
> * Deprecate the supportsBlink field of the DeviceTypeJson.DeviceType type [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.13.2 - 2022-01-25
|
||||
>
|
||||
> * Deprecate the logoUrl field of the DeviceTypeJson.DeviceType type [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.13.1 - 2022-01-21
|
||||
>
|
||||
> * Replace internal use of release.contains__image with release_image [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.13.0 - 2022-01-21
|
||||
>
|
||||
> * models: Deprecate the release.contains__image in favor of the term form [Thodoris Greasidis]
|
||||
> * models: Add the release_image term form property in the Release typings [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.12.1 - 2022-01-17
|
||||
>
|
||||
> * config.getConfigVarSchema: Send the token only when using a device type [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.12.0 - 2022-01-10
|
||||
>
|
||||
> * Replace DeviceTypeJson usage for alias resolution with model queries [Thodoris Greasidis]
|
||||
> * models/device-type: Support aliases as argument of the get() method [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.11.3 - 2022-01-09
|
||||
>
|
||||
> * Fix jsdoc example for balena.errors [Ken Bannister]
|
||||
>
|
||||
> ### balena-sdk-16.11.2 - Invalid date
|
||||
>
|
||||
> * tests: Convert auth spec to async await [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.11.1 - Invalid date
|
||||
>
|
||||
> * Fix buggy tests causing flakiness on node 16 [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.11.0 - Invalid date
|
||||
>
|
||||
> * Alias device.getManifestBySlug as config.getDeviceTypeManifestBySlug [Thodoris Greasidis]
|
||||
> * Deprecate device.getManifestByApplication [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.10.0 - Invalid date
|
||||
>
|
||||
> * application.get: Add support for retrieving applications by uuid [Thodoris Greasidis]
|
||||
> * package.json: Rename the lint-fix npm script to lint:fix [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.9.4 - 2021-12-29
|
||||
>
|
||||
> * os: Avoid mutating the args in getAvailableOsVersions & getAllOsVersion [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.9.3 - 2021-12-28
|
||||
>
|
||||
> * os: Replace semver normalization with balena-semver [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.9.2 - 2021-12-28
|
||||
>
|
||||
> * Stop relying on the balena-pine module [Thodoris Greasidis]
|
||||
>
|
||||
> ### balena-sdk-16.9.1 - 2021-12-28
|
||||
>
|
||||
> * Enable nested changelogs for balena-hup-action-utils [Thodoris Greasidis]
|
||||
>
|
||||
</details>
|
||||
|
||||
* Add provisioning key expiry date option to config generate options [Balena CI]
|
||||
|
||||
## 13.4.3 - 2022-05-19
|
||||
|
||||
|
||||
<details>
|
||||
<summary> Update docker-progress to 5.1.3 [Pagan Gazzard] </summary>
|
||||
|
||||
> ### docker-progress-5.1.3 - 2022-05-11
|
||||
>
|
||||
> * Reject on the stream closing if it has not already ended successfully [Pagan Gazzard]
|
||||
>
|
||||
> ### docker-progress-5.1.2 - 2022-05-10
|
||||
>
|
||||
> * Update dependencies [Pagan Gazzard]
|
||||
>
|
||||
> ### docker-progress-5.1.1 - 2022-05-10
|
||||
>
|
||||
> * Avoid breaking changes to PushPullOptions required properties [Kyle Harding]
|
||||
>
|
||||
> ### docker-progress-5.1.0 - 2022-03-10
|
||||
>
|
||||
> * Add support for building images with progress [Felipe Lalanne]
|
||||
>
|
||||
</details>
|
||||
|
||||
## 13.4.2 - 2022-05-10
|
||||
|
||||
|
||||
<details>
|
||||
<summary> preload: Fix detection of supervisor version for balenaOS v2.93.0 [Kyle Harding] </summary>
|
||||
|
||||
> ### balena-preload-12.0.1 - 2022-05-10
|
||||
>
|
||||
> * Update supervisor image regex to include tagged images [Kyle Harding]
|
||||
>
|
||||
</details>
|
||||
|
||||
## 13.4.1 - 2022-04-11
|
||||
|
||||
* leave: Update log message to advise that device still needs deleting [Taro Murao]
|
||||
|
@ -353,6 +353,7 @@ Examples:
|
||||
|
||||
$ balena fleet MyFleet
|
||||
$ balena fleet myorg/myfleet
|
||||
$ balena fleet myorg/myfleet --view
|
||||
|
||||
### Arguments
|
||||
|
||||
@ -362,6 +363,10 @@ fleet name, slug (preferred), or numeric ID (deprecated)
|
||||
|
||||
### Options
|
||||
|
||||
#### --view
|
||||
|
||||
open fleet dashboard page
|
||||
|
||||
## fleet create <name>
|
||||
|
||||
Create a new balena fleet.
|
||||
@ -680,6 +685,7 @@ Show information about a single device.
|
||||
Examples:
|
||||
|
||||
$ balena device 7cf02a6
|
||||
$ balena device 7cf02a6 --view
|
||||
|
||||
### Arguments
|
||||
|
||||
@ -689,6 +695,10 @@ the device uuid
|
||||
|
||||
### Options
|
||||
|
||||
#### --view
|
||||
|
||||
open device dashboard page
|
||||
|
||||
## device deactivate <uuid>
|
||||
|
||||
Deactivate a device.
|
||||
@ -811,6 +821,10 @@ path to the config JSON file, see `balena os build-config`
|
||||
|
||||
custom key name assigned to generated provisioning api key
|
||||
|
||||
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
||||
|
||||
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
||||
|
||||
## device local-mode <uuid>
|
||||
|
||||
Output current local mode status, or enable/disable local mode
|
||||
@ -2236,6 +2250,10 @@ paths to local files to place into the 'system-connections' directory
|
||||
|
||||
custom key name assigned to generated provisioning api key
|
||||
|
||||
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
||||
|
||||
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
||||
|
||||
## os initialize <image>
|
||||
|
||||
Initialize an os image for a device with a previously
|
||||
@ -2373,6 +2391,10 @@ supervisor cloud polling interval in minutes (e.g. for device variables)
|
||||
|
||||
custom key name assigned to generated provisioning api key
|
||||
|
||||
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
||||
|
||||
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
||||
|
||||
## config inject <file>
|
||||
|
||||
Inject a 'config.json' file to a balenaOS image file or attached SD card or
|
||||
@ -2715,6 +2737,7 @@ Examples:
|
||||
$ balena push myFleet
|
||||
$ balena push myFleet --source <source directory>
|
||||
$ balena push myFleet -s <source directory>
|
||||
$ balena push myFleet --source <source directory> --note "this is the note for this release"
|
||||
$ balena push myFleet --release-tag key1 "" key2 "value2 with spaces"
|
||||
$ balena push myorg/myfleet
|
||||
|
||||
@ -2831,6 +2854,10 @@ by the 'track latest' release policy but can be used through release pinning.
|
||||
Draft releases can be marked as final through the API. Releases are created
|
||||
as final by default unless this option is given.
|
||||
|
||||
#### --note NOTE
|
||||
|
||||
The notes for this release
|
||||
|
||||
# Settings
|
||||
|
||||
## settings
|
||||
@ -3196,6 +3223,7 @@ Examples:
|
||||
|
||||
$ balena deploy myFleet
|
||||
$ balena deploy myorg/myfleet --build --source myBuildDir/
|
||||
$ balena deploy myorg/myfleet --build --source myBuildDir/ --note "this is the note for this release"
|
||||
$ balena deploy myorg/myfleet myRepo/myImage
|
||||
$ balena deploy myFleet myRepo/myImage --release-tag key1 "" key2 "value2 with spaces"
|
||||
|
||||
@ -3236,6 +3264,10 @@ by the 'track latest' release policy but can be used through release pinning.
|
||||
Draft releases can be marked as final through the API. Releases are created
|
||||
as final by default unless this option is given.
|
||||
|
||||
#### --note NOTE
|
||||
|
||||
The notes for this release
|
||||
|
||||
#### -e, --emulated
|
||||
|
||||
Use QEMU for ARM architecture emulation during the image build
|
||||
|
@ -37,6 +37,7 @@ interface FlagsDef {
|
||||
wifiKey?: string;
|
||||
appUpdatePollInterval?: string;
|
||||
'provisioning-key-name'?: string;
|
||||
'provisioning-key-expiry-date'?: string;
|
||||
help: void;
|
||||
}
|
||||
|
||||
@ -81,7 +82,11 @@ export default class ConfigGenerateCmd extends Command {
|
||||
dev: cf.dev,
|
||||
device: {
|
||||
...cf.device,
|
||||
exclusive: ['fleet', 'provisioning-key-name'],
|
||||
exclusive: [
|
||||
'fleet',
|
||||
'provisioning-key-name',
|
||||
'provisioning-key-expiry-date',
|
||||
],
|
||||
},
|
||||
deviceApiKey: flags.string({
|
||||
description:
|
||||
@ -120,6 +125,11 @@ export default class ConfigGenerateCmd extends Command {
|
||||
description: 'custom key name assigned to generated provisioning api key',
|
||||
exclusive: ['device'],
|
||||
}),
|
||||
'provisioning-key-expiry-date': flags.string({
|
||||
description:
|
||||
'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)',
|
||||
exclusive: ['device'],
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
||||
@ -196,6 +206,7 @@ export default class ConfigGenerateCmd extends Command {
|
||||
answers.version = options.version;
|
||||
answers.developmentMode = options.dev;
|
||||
answers.provisioningKeyName = options['provisioning-key-name'];
|
||||
answers.provisioningKeyExpiryDate = options['provisioning-key-expiry-date'];
|
||||
|
||||
// Generate config
|
||||
const { generateDeviceConfig, generateApplicationConfig } = await import(
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { flags } from '@oclif/command';
|
||||
import type { ImageDescriptor } from 'resin-compose-parse';
|
||||
import type { ImageDescriptor } from '@balena/compose/dist/parse';
|
||||
|
||||
import Command from '../command';
|
||||
import { ExpectedError } from '../errors';
|
||||
@ -60,6 +60,7 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags {
|
||||
nologupload: boolean;
|
||||
'release-tag'?: string[];
|
||||
draft: boolean;
|
||||
note?: string;
|
||||
help: void;
|
||||
}
|
||||
|
||||
@ -101,6 +102,7 @@ ${dockerignoreHelp}
|
||||
public static examples = [
|
||||
'$ balena deploy myFleet',
|
||||
'$ balena deploy myorg/myfleet --build --source myBuildDir/',
|
||||
'$ balena deploy myorg/myfleet --build --source myBuildDir/ --note "this is the note for this release"',
|
||||
'$ balena deploy myorg/myfleet myRepo/myImage',
|
||||
'$ balena deploy myFleet myRepo/myImage --release-tag key1 "" key2 "value2 with spaces"',
|
||||
];
|
||||
@ -145,6 +147,7 @@ ${dockerignoreHelp}
|
||||
as final by default unless this option is given.`,
|
||||
default: false,
|
||||
}),
|
||||
note: flags.string({ description: 'The notes for this release' }),
|
||||
...composeCliFlags,
|
||||
...dockerCliFlags,
|
||||
// NOTE: Not supporting -h for help, because of clash with -h in DockerCliFlags
|
||||
@ -231,6 +234,9 @@ ${dockerignoreHelp}
|
||||
releaseTagKeys,
|
||||
releaseTagValues,
|
||||
);
|
||||
if (options.note) {
|
||||
await sdk.models.release.note(release.id, options.note);
|
||||
}
|
||||
}
|
||||
|
||||
async deployProject(
|
||||
|
@ -44,6 +44,7 @@ interface ExtendedDevice extends DeviceWithDeviceType {
|
||||
|
||||
interface FlagsDef {
|
||||
help: void;
|
||||
view: boolean;
|
||||
}
|
||||
|
||||
interface ArgsDef {
|
||||
@ -56,7 +57,10 @@ export default class DeviceCmd extends Command {
|
||||
|
||||
Show information about a single device.
|
||||
`;
|
||||
public static examples = ['$ balena device 7cf02a6'];
|
||||
public static examples = [
|
||||
'$ balena device 7cf02a6',
|
||||
'$ balena device 7cf02a6 --view',
|
||||
];
|
||||
|
||||
public static args: Array<IArg<any>> = [
|
||||
{
|
||||
@ -71,13 +75,19 @@ export default class DeviceCmd extends Command {
|
||||
|
||||
public static flags: flags.Input<FlagsDef> = {
|
||||
help: cf.help,
|
||||
view: flags.boolean({
|
||||
default: false,
|
||||
description: 'open device dashboard page',
|
||||
}),
|
||||
};
|
||||
|
||||
public static authenticated = true;
|
||||
public static primary = true;
|
||||
|
||||
public async run() {
|
||||
const { args: params } = this.parse<FlagsDef, ArgsDef>(DeviceCmd);
|
||||
const { args: params, flags: options } = this.parse<FlagsDef, ArgsDef>(
|
||||
DeviceCmd,
|
||||
);
|
||||
|
||||
const balena = getBalenaSdk();
|
||||
|
||||
@ -108,6 +118,14 @@ export default class DeviceCmd extends Command {
|
||||
],
|
||||
...expandForAppName,
|
||||
})) as ExtendedDevice;
|
||||
|
||||
if (options.view) {
|
||||
const open = await import('open');
|
||||
const dashboardUrl = balena.models.device.getDashboardUrl(device.uuid);
|
||||
await open(dashboardUrl, { wait: false });
|
||||
return;
|
||||
}
|
||||
|
||||
device.status = device.overall_status;
|
||||
|
||||
device.dashboard_url = balena.models.device.getDashboardUrl(device.uuid);
|
||||
|
@ -31,6 +31,7 @@ interface FlagsDef {
|
||||
config?: string;
|
||||
help: void;
|
||||
'provisioning-key-name'?: string;
|
||||
'provisioning-key-expiry-date'?: string;
|
||||
}
|
||||
|
||||
export default class DeviceInitCmd extends Command {
|
||||
@ -97,6 +98,10 @@ export default class DeviceInitCmd extends Command {
|
||||
'provisioning-key-name': flags.string({
|
||||
description: 'custom key name assigned to generated provisioning api key',
|
||||
}),
|
||||
'provisioning-key-expiry-date': flags.string({
|
||||
description:
|
||||
'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)',
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
||||
@ -185,6 +190,14 @@ export default class DeviceInitCmd extends Command {
|
||||
options['provisioning-key-name'],
|
||||
);
|
||||
}
|
||||
|
||||
if (options['provisioning-key-expiry-date']) {
|
||||
configureCommand.push(
|
||||
'--provisioning-key-expiry-date',
|
||||
options['provisioning-key-expiry-date'],
|
||||
);
|
||||
}
|
||||
|
||||
await runCommand(configureCommand);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { flags } from '@oclif/command';
|
||||
import type { flags as flagsType } from '@oclif/command';
|
||||
import { flags } from '@oclif/command';
|
||||
import type { Release } from 'balena-sdk';
|
||||
|
||||
import Command from '../../command';
|
||||
@ -28,6 +29,7 @@ import type { DataOutputOptions } from '../../framework';
|
||||
|
||||
interface FlagsDef extends DataOutputOptions {
|
||||
help: void;
|
||||
view: boolean;
|
||||
}
|
||||
|
||||
interface ArgsDef {
|
||||
@ -45,14 +47,19 @@ export default class FleetCmd extends Command {
|
||||
public static examples = [
|
||||
'$ balena fleet MyFleet',
|
||||
'$ balena fleet myorg/myfleet',
|
||||
'$ balena fleet myorg/myfleet --view',
|
||||
];
|
||||
|
||||
public static args = [ca.fleetRequired];
|
||||
|
||||
public static usage = 'fleet <fleet>';
|
||||
|
||||
public static flags: flags.Input<FlagsDef> = {
|
||||
public static flags: flagsType.Input<FlagsDef> = {
|
||||
help: cf.help,
|
||||
view: flags.boolean({
|
||||
default: false,
|
||||
description: 'open fleet dashboard page',
|
||||
}),
|
||||
...(isV14() ? cf.dataOutputFlags : {}),
|
||||
};
|
||||
|
||||
@ -66,7 +73,9 @@ export default class FleetCmd extends Command {
|
||||
|
||||
const { getApplication } = await import('../../utils/sdk');
|
||||
|
||||
const application = (await getApplication(getBalenaSdk(), params.fleet, {
|
||||
const balena = getBalenaSdk();
|
||||
|
||||
const application = (await getApplication(balena, params.fleet, {
|
||||
$expand: {
|
||||
is_for__device_type: { $select: 'slug' },
|
||||
should_be_running__release: { $select: 'commit' },
|
||||
@ -78,6 +87,15 @@ export default class FleetCmd extends Command {
|
||||
commit?: string;
|
||||
};
|
||||
|
||||
if (options.view) {
|
||||
const open = await import('open');
|
||||
const dashboardUrl = balena.models.application.getDashboardUrl(
|
||||
application.id,
|
||||
);
|
||||
await open(dashboardUrl, { wait: false });
|
||||
return;
|
||||
}
|
||||
|
||||
application.device_type = application.is_for__device_type[0].slug;
|
||||
application.commit = application.should_be_running__release[0]?.commit;
|
||||
|
||||
|
@ -43,6 +43,7 @@ interface FlagsDef {
|
||||
'system-connection': string[];
|
||||
'initial-device-name'?: string;
|
||||
'provisioning-key-name'?: string;
|
||||
'provisioning-key-expiry-date'?: string;
|
||||
}
|
||||
|
||||
interface ArgsDef {
|
||||
@ -58,6 +59,7 @@ interface Answers {
|
||||
wifiSsid?: string;
|
||||
wifiKey?: string;
|
||||
provisioningKeyName?: string;
|
||||
provisioningKeyExpiryDate?: string;
|
||||
}
|
||||
|
||||
export default class OsConfigureCmd extends Command {
|
||||
@ -121,7 +123,7 @@ export default class OsConfigureCmd extends Command {
|
||||
config: flags.string({
|
||||
description:
|
||||
'path to a pre-generated config.json file to be injected in the OS image',
|
||||
exclusive: ['provisioning-key-name'],
|
||||
exclusive: ['provisioning-key-name', 'provisioning-key-expiry-date'],
|
||||
}),
|
||||
'config-app-update-poll-interval': flags.integer({
|
||||
description:
|
||||
@ -138,7 +140,14 @@ export default class OsConfigureCmd extends Command {
|
||||
description: 'WiFi SSID (network name) (non-interactive configuration)',
|
||||
}),
|
||||
dev: cf.dev,
|
||||
device: { ...cf.device, exclusive: ['fleet', 'provisioning-key-name'] },
|
||||
device: {
|
||||
...cf.device,
|
||||
exclusive: [
|
||||
'fleet',
|
||||
'provisioning-key-name',
|
||||
'provisioning-key-expiry-date',
|
||||
],
|
||||
},
|
||||
'device-type': flags.string({
|
||||
description:
|
||||
'device type slug (e.g. "raspberrypi3") to override the fleet device type',
|
||||
@ -161,6 +170,11 @@ export default class OsConfigureCmd extends Command {
|
||||
description: 'custom key name assigned to generated provisioning api key',
|
||||
exclusive: ['config', 'device'],
|
||||
}),
|
||||
'provisioning-key-expiry-date': flags.string({
|
||||
description:
|
||||
'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)',
|
||||
exclusive: ['config', 'device'],
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
||||
@ -235,6 +249,7 @@ export default class OsConfigureCmd extends Command {
|
||||
answers.version = osVersion;
|
||||
answers.developmentMode = options.dev;
|
||||
answers.provisioningKeyName = options['provisioning-key-name'];
|
||||
answers.provisioningKeyExpiryDate = options['provisioning-key-expiry-date'];
|
||||
|
||||
if (_.isEmpty(configJson)) {
|
||||
if (device) {
|
||||
|
@ -22,7 +22,7 @@ import { getBalenaSdk, stripIndent } from '../utils/lazy';
|
||||
import { dockerignoreHelp, registrySecretsHelp } from '../utils/messages';
|
||||
import type { BalenaSDK } from 'balena-sdk';
|
||||
import { ExpectedError, instanceOf } from '../errors';
|
||||
import { RegistrySecrets } from 'resin-multibuild';
|
||||
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import { lowercaseIfSlug } from '../utils/normalization';
|
||||
import {
|
||||
applyReleaseTagKeysAndValues,
|
||||
@ -55,6 +55,7 @@ interface FlagsDef {
|
||||
'multi-dockerignore': boolean;
|
||||
'release-tag'?: string[];
|
||||
draft: boolean;
|
||||
note?: string;
|
||||
help: void;
|
||||
}
|
||||
|
||||
@ -97,6 +98,7 @@ export default class PushCmd extends Command {
|
||||
'$ balena push myFleet',
|
||||
'$ balena push myFleet --source <source directory>',
|
||||
'$ balena push myFleet -s <source directory>',
|
||||
'$ balena push myFleet --source <source directory> --note "this is the note for this release"',
|
||||
'$ balena push myFleet --release-tag key1 "" key2 "value2 with spaces"',
|
||||
'$ balena push myorg/myfleet',
|
||||
'',
|
||||
@ -241,6 +243,7 @@ export default class PushCmd extends Command {
|
||||
as final by default unless this option is given.`,
|
||||
default: false,
|
||||
}),
|
||||
note: flags.string({ description: 'The notes for this release' }),
|
||||
help: cf.help,
|
||||
};
|
||||
|
||||
@ -354,6 +357,9 @@ export default class PushCmd extends Command {
|
||||
releaseTagKeys,
|
||||
releaseTagValues,
|
||||
);
|
||||
if (options.note) {
|
||||
await sdk.models.release.note(releaseId, options.note);
|
||||
}
|
||||
} else if (releaseTagKeys.length > 0) {
|
||||
throw new Error(stripIndent`
|
||||
A release ID could not be parsed out of the builder's output.
|
||||
|
13
lib/utils/compose-types.d.ts
vendored
13
lib/utils/compose-types.d.ts
vendored
@ -15,8 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { ImageModel, ReleaseModel } from 'balena-release/build/models';
|
||||
import type { Composition, ImageDescriptor } from 'resin-compose-parse';
|
||||
import type {
|
||||
ImageModel,
|
||||
ReleaseModel,
|
||||
} from '@balena/compose/dist/release/models';
|
||||
import type { Composition, ImageDescriptor } from '@balena/compose/dist/parse';
|
||||
import type { Pack } from 'tar-stream';
|
||||
|
||||
interface Image {
|
||||
@ -39,7 +42,7 @@ export interface BuiltImage {
|
||||
|
||||
export interface TaggedImage {
|
||||
localImage: import('dockerode').Image;
|
||||
serviceImage: import('balena-release/build/models').ImageModel;
|
||||
serviceImage: import('@balena/compose/dist/release/models').ImageModel;
|
||||
serviceName: string;
|
||||
logs: string;
|
||||
props: BuiltImage.props;
|
||||
@ -78,7 +81,9 @@ export interface ComposeProject {
|
||||
}
|
||||
|
||||
export interface Release {
|
||||
client: ReturnType<typeof import('balena-release').createClient>;
|
||||
client: ReturnType<
|
||||
typeof import('@balena/compose/dist/release').createClient
|
||||
>;
|
||||
release: Pick<
|
||||
ReleaseModel,
|
||||
| 'id'
|
||||
|
@ -19,7 +19,7 @@ import type { Renderer } from './compose_ts';
|
||||
import type * as SDK from 'balena-sdk';
|
||||
import type Dockerode = require('dockerode');
|
||||
import * as path from 'path';
|
||||
import type { Composition, ImageDescriptor } from 'resin-compose-parse';
|
||||
import type { Composition, ImageDescriptor } from '@balena/compose/dist/parse';
|
||||
import type {
|
||||
BuiltImage,
|
||||
ComposeOpts,
|
||||
@ -64,7 +64,7 @@ export function createProject(
|
||||
): ComposeProject {
|
||||
const yml = require('js-yaml') as typeof import('js-yaml');
|
||||
const compose =
|
||||
require('resin-compose-parse') as typeof import('resin-compose-parse');
|
||||
require('@balena/compose/dist/parse') as typeof import('@balena/compose/dist/parse');
|
||||
|
||||
// both methods below may throw.
|
||||
const rawComposition = yml.load(composeStr);
|
||||
@ -107,7 +107,7 @@ export const createRelease = async function (
|
||||
const _ = require('lodash') as typeof import('lodash');
|
||||
const crypto = require('crypto') as typeof import('crypto');
|
||||
const releaseMod =
|
||||
require('balena-release') as typeof import('balena-release');
|
||||
require('@balena/compose/dist/release') as typeof import('@balena/compose/dist/release');
|
||||
|
||||
const client = releaseMod.createClient({ apiEndpoint, auth });
|
||||
|
||||
@ -214,7 +214,7 @@ export const getPreviousRepos = (
|
||||
image: [SDK.Image];
|
||||
}>;
|
||||
const { getRegistryAndName } =
|
||||
require('resin-multibuild') as typeof import('resin-multibuild');
|
||||
require('@balena/compose/dist/multibuild') as typeof import('@balena/compose/dist/multibuild');
|
||||
return Promise.all(
|
||||
images.map(function (d) {
|
||||
const imageName = d.image[0].is_stored_at__image_location || '';
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
import { flags } from '@oclif/command';
|
||||
import { BalenaSDK } from 'balena-sdk';
|
||||
import type { TransposeOptions } from 'docker-qemu-transpose';
|
||||
import type { TransposeOptions } from '@balena/compose/dist/emulate';
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import { promises as fs } from 'fs';
|
||||
import jsyaml = require('js-yaml');
|
||||
@ -26,8 +26,8 @@ import type {
|
||||
BuildConfig,
|
||||
Composition,
|
||||
ImageDescriptor,
|
||||
} from 'resin-compose-parse';
|
||||
import type * as MultiBuild from 'resin-multibuild';
|
||||
} from '@balena/compose/dist/parse';
|
||||
import type * as MultiBuild from '@balena/compose/dist/multibuild';
|
||||
import * as semver from 'semver';
|
||||
import type { Duplex, Readable } from 'stream';
|
||||
import type { Pack } from 'tar-stream';
|
||||
@ -118,7 +118,7 @@ export async function loadProject(
|
||||
image?: string,
|
||||
imageTag?: string,
|
||||
): Promise<ComposeProject> {
|
||||
const compose = await import('resin-compose-parse');
|
||||
const compose = await import('@balena/compose/dist/parse');
|
||||
const { createProject } = await import('./compose');
|
||||
let composeName: string;
|
||||
let composeStr: string;
|
||||
@ -262,7 +262,7 @@ export async function buildProject(
|
||||
opts: BuildProjectOpts,
|
||||
): Promise<BuiltImage[]> {
|
||||
await checkBuildSecretsRequirements(opts.docker, opts.projectPath);
|
||||
const compose = await import('resin-compose-parse');
|
||||
const compose = await import('@balena/compose/dist/parse');
|
||||
const imageDescriptors = compose.parse(opts.composition);
|
||||
const renderer = await startRenderer({ imageDescriptors, ...opts });
|
||||
let buildSummaryByService: Dictionary<string> | undefined;
|
||||
@ -333,7 +333,7 @@ async function $buildProject(
|
||||
logger.logDebug('Prepared tasks; building...');
|
||||
|
||||
const { BALENA_ENGINE_TMP_PATH } = await import('../config');
|
||||
const builder = await import('resin-multibuild');
|
||||
const builder = await import('@balena/compose/dist/multibuild');
|
||||
|
||||
const builtImages = await builder.performBuilds(
|
||||
tasks,
|
||||
@ -481,8 +481,9 @@ async function qemuTransposeBuildStream({
|
||||
throw new Error(`No buildStream for task '${task.tag}'`);
|
||||
}
|
||||
|
||||
const transpose = await import('docker-qemu-transpose');
|
||||
const { toPosixPath } = (await import('resin-multibuild')).PathUtils;
|
||||
const transpose = await import('@balena/compose/dist/emulate');
|
||||
const { toPosixPath } = (await import('@balena/compose/dist/multibuild'))
|
||||
.PathUtils;
|
||||
|
||||
const transposeOptions: TransposeOptions = {
|
||||
hostQemuPath: toPosixPath(binPath),
|
||||
@ -508,9 +509,9 @@ async function setTaskProgressHooks({
|
||||
inlineLogs?: boolean;
|
||||
renderer: Renderer;
|
||||
task: BuildTaskPlus;
|
||||
transposeOptions?: import('docker-qemu-transpose').TransposeOptions;
|
||||
transposeOptions?: import('@balena/compose/dist/emulate').TransposeOptions;
|
||||
}) {
|
||||
const transpose = await import('docker-qemu-transpose');
|
||||
const transpose = await import('@balena/compose/dist/emulate');
|
||||
// Get the service-specific log stream
|
||||
const logStream = renderer.streams[task.serviceName];
|
||||
task.logBuffer = [];
|
||||
@ -724,16 +725,16 @@ export async function getServiceDirsFromComposition(
|
||||
*
|
||||
* The `image` argument may therefore refer to either a `build` or `image` property
|
||||
* of a service in a docker-compose.yml file, which is a bit confusing but it matches
|
||||
* the `ImageDescriptor.image` property as defined by `resin-compose-parse`.
|
||||
* the `ImageDescriptor.image` property as defined by `@balena/compose/parse`.
|
||||
*
|
||||
* Note that `resin-compose-parse` "normalizes" the docker-compose.yml file such
|
||||
* Note that `@balena/compose/parse` "normalizes" the docker-compose.yml file such
|
||||
* that, if `services.service.build` is a string, it is converted to a BuildConfig
|
||||
* object with the string value assigned to `services.service.build.context`:
|
||||
* https://github.com/balena-io-modules/resin-compose-parse/blob/v2.1.3/src/compose.ts#L166-L167
|
||||
* https://github.com/balena-io-modules/balena-compose/blob/v0.1.0/lib/parse/compose.ts#L166-L167
|
||||
* This is why this implementation works when `services.service.build` is defined
|
||||
* as a string in the docker-compose.yml file.
|
||||
*
|
||||
* @param image The `ImageDescriptor.image` attribute parsed with `resin-compose-parse`
|
||||
* @param image The `ImageDescriptor.image` attribute parsed with `@balena/compose/parse`
|
||||
*/
|
||||
export function isBuildConfig(
|
||||
image: string | BuildConfig,
|
||||
@ -759,7 +760,8 @@ export async function tarDirectory(
|
||||
}: TarDirectoryOptions,
|
||||
): Promise<import('stream').Readable> {
|
||||
const { filterFilesWithDockerignore } = await import('./ignore');
|
||||
const { toPosixPath } = (await import('resin-multibuild')).PathUtils;
|
||||
const { toPosixPath } = (await import('@balena/compose/dist/multibuild'))
|
||||
.PathUtils;
|
||||
|
||||
let readFile: (file: string) => Promise<Buffer>;
|
||||
if (process.platform === 'win32') {
|
||||
@ -941,7 +943,7 @@ async function parseRegistrySecrets(
|
||||
throw new ExpectedError('Filename must end with .json, .yml or .yaml');
|
||||
}
|
||||
const raw = (await fs.readFile(secretsFilename)).toString();
|
||||
const multiBuild = await import('resin-multibuild');
|
||||
const multiBuild = await import('@balena/compose/dist/multibuild');
|
||||
const registrySecrets =
|
||||
new multiBuild.RegistrySecretValidator().validateRegistrySecrets(
|
||||
isYaml ? require('js-yaml').load(raw) : JSON.parse(raw),
|
||||
@ -970,7 +972,7 @@ export async function makeBuildTasks(
|
||||
releaseHash: string = 'unavailable',
|
||||
preprocessHook?: (dockerfile: string) => string,
|
||||
): Promise<MultiBuild.BuildTask[]> {
|
||||
const multiBuild = await import('resin-multibuild');
|
||||
const multiBuild = await import('@balena/compose/dist/multibuild');
|
||||
const buildTasks = await multiBuild.splitBuildStream(composition, tarStream);
|
||||
|
||||
logger.logDebug('Found build tasks:');
|
||||
@ -1016,7 +1018,7 @@ async function performResolution(
|
||||
releaseHash: string,
|
||||
preprocessHook?: (dockerfile: string) => string,
|
||||
): Promise<MultiBuild.BuildTask[]> {
|
||||
const multiBuild = await import('resin-multibuild');
|
||||
const multiBuild = await import('@balena/compose/dist/multibuild');
|
||||
const resolveListeners: MultiBuild.ResolveListeners = {};
|
||||
const resolvePromise = new Promise<never>((_resolve, reject) => {
|
||||
resolveListeners.error = [reject];
|
||||
@ -1081,7 +1083,7 @@ async function validateSpecifiedDockerfile(
|
||||
dockerfilePath: string,
|
||||
): Promise<string> {
|
||||
const { contains, toNativePath, toPosixPath } = (
|
||||
await import('resin-multibuild')
|
||||
await import('@balena/compose/dist/multibuild')
|
||||
).PathUtils;
|
||||
|
||||
const nativeProjectPath = path.normalize(projectPath);
|
||||
@ -1241,7 +1243,7 @@ async function pushAndUpdateServiceImages(
|
||||
token: string,
|
||||
images: TaggedImage[],
|
||||
afterEach: (
|
||||
serviceImage: import('balena-release/build/models').ImageModel,
|
||||
serviceImage: import('@balena/compose/dist/release/models').ImageModel,
|
||||
props: object,
|
||||
) => void,
|
||||
) {
|
||||
@ -1326,12 +1328,14 @@ async function pushAndUpdateServiceImages(
|
||||
async function pushServiceImages(
|
||||
docker: Dockerode,
|
||||
logger: Logger,
|
||||
pineClient: ReturnType<typeof import('balena-release').createClient>,
|
||||
pineClient: ReturnType<
|
||||
typeof import('@balena/compose/dist/release').createClient
|
||||
>,
|
||||
taggedImages: TaggedImage[],
|
||||
token: string,
|
||||
skipLogUpload: boolean,
|
||||
): Promise<void> {
|
||||
const releaseMod = await import('balena-release');
|
||||
const releaseMod = await import('@balena/compose/dist/release');
|
||||
logger.logInfo('Pushing images to registry...');
|
||||
await pushAndUpdateServiceImages(
|
||||
docker,
|
||||
@ -1361,8 +1365,8 @@ export async function deployProject(
|
||||
skipLogUpload: boolean,
|
||||
projectPath: string,
|
||||
isDraft: boolean,
|
||||
): Promise<import('balena-release/build/models').ReleaseModel> {
|
||||
const releaseMod = await import('balena-release');
|
||||
): Promise<import('@balena/compose/dist/release/models').ReleaseModel> {
|
||||
const releaseMod = await import('@balena/compose/dist/release');
|
||||
const { createRelease, tagServiceImages } = await import('./compose');
|
||||
const tty = (await import('./tty'))(process.stdout);
|
||||
|
||||
|
@ -18,13 +18,13 @@
|
||||
import * as semver from 'balena-semver';
|
||||
import * as Docker from 'dockerode';
|
||||
import * as _ from 'lodash';
|
||||
import { Composition } from 'resin-compose-parse';
|
||||
import { Composition } from '@balena/compose/dist/parse';
|
||||
import {
|
||||
BuildTask,
|
||||
getAuthConfigObj,
|
||||
LocalImage,
|
||||
RegistrySecrets,
|
||||
} from 'resin-multibuild';
|
||||
} from '@balena/compose/dist/multibuild';
|
||||
import type { Readable } from 'stream';
|
||||
|
||||
import { BALENA_ENGINE_TMP_PATH } from '../../config';
|
||||
@ -321,7 +321,7 @@ async function performBuilds(
|
||||
opts: DeviceDeployOptions,
|
||||
buildLogs?: Dictionary<string>,
|
||||
): Promise<BuildTask[]> {
|
||||
const multibuild = await import('resin-multibuild');
|
||||
const multibuild = await import('@balena/compose/dist/multibuild');
|
||||
|
||||
const buildTasks = await makeBuildTasks(
|
||||
composition,
|
||||
@ -370,7 +370,7 @@ async function performBuilds(
|
||||
const imagesToRemove: string[] = [];
|
||||
|
||||
// Now tag any external images with the correct name that they should be,
|
||||
// as this won't be done by resin-multibuild
|
||||
// as this won't be done by @balena/compose/multibuild
|
||||
await Promise.all(
|
||||
localImages.map(async (localImage) => {
|
||||
if (localImage.external) {
|
||||
@ -414,7 +414,7 @@ export async function rebuildSingleTask(
|
||||
// this should provide the following callback
|
||||
containerIdCb?: (id: string) => void,
|
||||
): Promise<string> {
|
||||
const multibuild = await import('resin-multibuild');
|
||||
const multibuild = await import('@balena/compose/dist/multibuild');
|
||||
// First we run the build task, to get the new image id
|
||||
let buildLogs = '';
|
||||
const logHandler = (_s: string, line: string) => {
|
||||
@ -533,10 +533,17 @@ async function assignDockerBuildOpts(
|
||||
await Promise.all(
|
||||
buildTasks.map(async (task: BuildTask) => {
|
||||
task.dockerOpts = {
|
||||
cachefrom: images,
|
||||
labels: {
|
||||
'io.resin.local.image': '1',
|
||||
'io.resin.local.service': task.serviceName,
|
||||
...(task.dockerOpts || {}),
|
||||
...{
|
||||
cachefrom: images,
|
||||
labels: {
|
||||
'io.resin.local.image': '1',
|
||||
'io.resin.local.service': task.serviceName,
|
||||
},
|
||||
t: getImageNameFromTask(task),
|
||||
nocache: opts.nocache,
|
||||
forcerm: true,
|
||||
pull: opts.pull,
|
||||
},
|
||||
t: getImageNameFromTask(task),
|
||||
nocache: opts.nocache,
|
||||
|
@ -21,8 +21,8 @@ import * as fs from 'fs';
|
||||
import Livepush, { ContainerNotRunningError } from 'livepush';
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
import type { Composition } from 'resin-compose-parse';
|
||||
import type { BuildTask } from 'resin-multibuild';
|
||||
import type { Composition } from '@balena/compose/dist/parse';
|
||||
import type { BuildTask } from '@balena/compose/dist/multibuild';
|
||||
|
||||
import { instanceOf } from '../../errors';
|
||||
import Logger = require('../logger');
|
||||
|
@ -105,7 +105,7 @@ export interface BuildOpts {
|
||||
cachefrom?: string[];
|
||||
nocache?: boolean;
|
||||
pull?: boolean;
|
||||
registryconfig?: import('resin-multibuild').RegistrySecrets;
|
||||
registryconfig?: import('@balena/compose/dist/multibuild').RegistrySecrets;
|
||||
squash?: boolean;
|
||||
t?: string; // only the tag portion of the image name, e.g. 'abc' in 'myimg:abc'
|
||||
}
|
||||
@ -132,7 +132,7 @@ export function generateBuildOpts(options: {
|
||||
'cache-from'?: string;
|
||||
nocache: boolean;
|
||||
pull?: boolean;
|
||||
'registry-secrets'?: import('resin-multibuild').RegistrySecrets;
|
||||
'registry-secrets'?: import('@balena/compose/dist/multibuild').RegistrySecrets;
|
||||
squash: boolean;
|
||||
tag?: string;
|
||||
}): BuildOpts {
|
||||
|
@ -21,7 +21,7 @@ import { ExpectedError } from '../errors';
|
||||
import { getBalenaSdk, stripIndent } from './lazy';
|
||||
import Logger = require('./logger');
|
||||
|
||||
export const QEMU_VERSION = 'v6.0.0+balena1';
|
||||
export const QEMU_VERSION = 'v7.0.0+balena1';
|
||||
export const QEMU_BIN_NAME = 'qemu-execve';
|
||||
|
||||
export function qemuPathInContext(context: string) {
|
||||
|
@ -17,7 +17,7 @@ import type { BalenaSDK } from 'balena-sdk';
|
||||
import * as JSONStream from 'JSONStream';
|
||||
import * as readline from 'readline';
|
||||
import * as request from 'request';
|
||||
import { RegistrySecrets } from 'resin-multibuild';
|
||||
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import type * as Stream from 'stream';
|
||||
import streamToPromise = require('stream-to-promise');
|
||||
import type { Pack } from 'tar-stream';
|
||||
|
1055
npm-shrinkwrap.json
generated
1055
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "balena-cli",
|
||||
"version": "13.4.1",
|
||||
"version": "13.10.1",
|
||||
"description": "The official balena Command Line Interface",
|
||||
"main": "./build/app.js",
|
||||
"homepage": "https://github.com/balena-io/balena-cli",
|
||||
@ -29,7 +29,7 @@
|
||||
"node_modules/balena-sdk/es2018/index.js",
|
||||
"node_modules/balena-sync/build/**/*.js",
|
||||
"node_modules/pinejs-client-request/node_modules/pinejs-client-core/es2018/index.js",
|
||||
"node_modules/resin-compose-parse/build/schemas/*.json"
|
||||
"node_modules/@balena/compose/dist/parse/schemas/*.json"
|
||||
],
|
||||
"assets": [
|
||||
"build/auth/pages/*.ejs",
|
||||
@ -127,7 +127,7 @@
|
||||
"@types/chai-as-promised": "^7.1.4",
|
||||
"@types/cli-truncate": "^2.0.0",
|
||||
"@types/common-tags": "^1.8.1",
|
||||
"@types/dockerode": "^3.3.8",
|
||||
"@types/dockerode": "^3.3.9",
|
||||
"@types/ejs": "^3.1.0",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
@ -191,9 +191,10 @@
|
||||
"simple-git": "^2.48.0",
|
||||
"sinon": "^11.1.2",
|
||||
"ts-node": "^10.4.0",
|
||||
"typescript": "^4.5.4"
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@balena/compose": "^2.1.1",
|
||||
"@balena/dockerignore": "^1.0.2",
|
||||
"@balena/es-version": "^1.0.1",
|
||||
"@oclif/command": "^1.8.16",
|
||||
@ -206,10 +207,9 @@
|
||||
"balena-device-init": "^6.0.0",
|
||||
"balena-errors": "^4.7.1",
|
||||
"balena-image-fs": "^7.0.6",
|
||||
"balena-image-manager": "^7.1.1",
|
||||
"balena-preload": "^12.0.0",
|
||||
"balena-release": "^3.2.0",
|
||||
"balena-sdk": "^16.9.0",
|
||||
"balena-image-manager": "^8.0.0",
|
||||
"balena-preload": "^12.1.0",
|
||||
"balena-sdk": "^16.22.0",
|
||||
"balena-semver": "^2.3.0",
|
||||
"balena-settings-client": "^4.0.7",
|
||||
"balena-settings-storage": "^7.0.0",
|
||||
@ -225,8 +225,7 @@
|
||||
"common-tags": "^1.7.2",
|
||||
"denymount": "^2.3.0",
|
||||
"docker-modem": "3.0.0",
|
||||
"docker-progress": "^5.0.1",
|
||||
"docker-qemu-transpose": "^1.1.1",
|
||||
"docker-progress": "^5.1.3",
|
||||
"dockerode": "^3.3.1",
|
||||
"ejs": "^3.1.6",
|
||||
"etcher-sdk": "^6.2.1",
|
||||
@ -264,9 +263,7 @@
|
||||
"request": "^2.88.2",
|
||||
"resin-cli-form": "^2.0.2",
|
||||
"resin-cli-visuals": "^1.8.0",
|
||||
"resin-compose-parse": "^2.1.3",
|
||||
"resin-doodles": "^0.2.0",
|
||||
"resin-multibuild": "^4.12.2",
|
||||
"resin-stream-logger": "^0.1.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
@ -288,6 +285,6 @@
|
||||
"windosu": "^0.3.0"
|
||||
},
|
||||
"versionist": {
|
||||
"publishedAt": "2022-04-11T16:10:47.566Z"
|
||||
"publishedAt": "2022-08-01T16:39:17.325Z"
|
||||
}
|
||||
}
|
||||
|
4
repo.yml
4
repo.yml
@ -14,7 +14,7 @@ upstream:
|
||||
url: 'https://github.com/balena-io-modules/balena-sync'
|
||||
- repo: 'etcher-sdk'
|
||||
url: 'https://github.com/balena-io-modules/etcher-sdk/'
|
||||
- repo: 'resin-compose-parse'
|
||||
url: 'https://github.com/balena-io-modules/resin-compose-parse'
|
||||
- repo: 'balena-compose'
|
||||
url: 'https://github.com/balena-io-modules/balena-compose'
|
||||
- repo: 'docker-progress'
|
||||
url: 'https://github.com/balena-io-modules/docker-progress'
|
||||
|
@ -6,7 +6,6 @@ const johnDoe = {
|
||||
gitlab_id: 1325,
|
||||
social_service_account: null,
|
||||
hasPasswordSet: true,
|
||||
needsPasswordReset: false,
|
||||
public_key: false,
|
||||
features: [],
|
||||
id: 1344,
|
||||
@ -21,7 +20,6 @@ const janeDoe = {
|
||||
social_service_account: null,
|
||||
has_disabled_newsletter: true,
|
||||
hasPasswordSet: true,
|
||||
needsPasswordReset: false,
|
||||
public_key: false,
|
||||
features: [],
|
||||
intercomUserHash:
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { Request as ReleaseRequest } from 'balena-release';
|
||||
import type { Request as ReleaseRequest } from '@balena/compose/dist/release';
|
||||
import { expect } from 'chai';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as _ from 'lodash';
|
||||
@ -291,7 +291,7 @@ describe('balena deploy', function () {
|
||||
statusCode: 500,
|
||||
inspectRequest: (_uri, requestBody) => {
|
||||
const imageBody = requestBody as Partial<
|
||||
import('balena-release/build/models').ImageModel
|
||||
import('@balena/compose/dist/release/models').ImageModel
|
||||
>;
|
||||
expect(imageBody.status).to.equal('success');
|
||||
},
|
||||
@ -300,7 +300,7 @@ describe('balena deploy', function () {
|
||||
api.expectPatchRelease({
|
||||
inspectRequest: (_uri, requestBody) => {
|
||||
const releaseBody = requestBody as Partial<
|
||||
import('balena-release/build/models').ReleaseModel
|
||||
import('@balena/compose/dist/release/models').ReleaseModel
|
||||
>;
|
||||
expect(releaseBody.status).to.equal('failed');
|
||||
},
|
||||
|
@ -59,6 +59,7 @@ if (process.platform !== 'win32') {
|
||||
'--config-network ethernet',
|
||||
'--initial-device-name testDeviceName',
|
||||
'--provisioning-key-name testKey',
|
||||
'--provisioning-key-expiry-date 2050-12-12',
|
||||
];
|
||||
|
||||
const { err } = await runCommand(command.join(' '));
|
||||
|
@ -19,7 +19,7 @@ import { expect } from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import { PathUtils } from 'resin-multibuild';
|
||||
import { PathUtils } from '@balena/compose/dist/multibuild';
|
||||
import rewire = require('rewire');
|
||||
import * as sinon from 'sinon';
|
||||
import { Readable } from 'stream';
|
||||
|
@ -64,6 +64,12 @@
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules/patch-package/node_modules/open/xdg-open
|
||||
%2: path-to-executable/xdg-open
|
||||
> Warning Cannot resolve 'path'
|
||||
node_modules/@balena/compose/dist/parse/schemas/index.js
|
||||
Dynamic require may fail at run time, because the requested file
|
||||
is unknown at compilation time and not included into executable.
|
||||
Use a string literal as an argument for 'require', or leave it
|
||||
as is and specify the resolved file name in 'scripts' option.
|
||||
> Warning Cannot include file %1 into executable.
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules/drivelist/build/Release/drivelist.node
|
||||
|
@ -64,6 +64,12 @@
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules/patch-package/node_modules/open/xdg-open
|
||||
%2: path-to-executable/xdg-open
|
||||
> Warning Cannot resolve 'path'
|
||||
node_modules/@balena/compose/dist/parse/schemas/index.js
|
||||
Dynamic require may fail at run time, because the requested file
|
||||
is unknown at compilation time and not included into executable.
|
||||
Use a string literal as an argument for 'require', or leave it
|
||||
as is and specify the resolved file name in 'scripts' option.
|
||||
> Warning Cannot include file %1 into executable.
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules/drivelist/build/Release/drivelist.node
|
||||
|
@ -64,6 +64,12 @@
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules\patch-package\node_modules\open\xdg-open
|
||||
%2: path-to-executable/xdg-open
|
||||
> Warning Cannot resolve 'path'
|
||||
node_modules\@balena\compose\dist\parse\schemas\index.js
|
||||
Dynamic require may fail at run time, because the requested file
|
||||
is unknown at compilation time and not included into executable.
|
||||
Use a string literal as an argument for 'require', or leave it
|
||||
as is and specify the resolved file name in 'scripts' option.
|
||||
> Warning Cannot include file %1 into executable.
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules\drivelist\build\Release\drivelist.node
|
||||
|
@ -79,7 +79,7 @@ describeSS('LivepushManager::setupFilesystemWatcher', function () {
|
||||
|
||||
async function createMonitors(
|
||||
projectPath: string,
|
||||
composition: import('resin-compose-parse').Composition,
|
||||
composition: import('@balena/compose/dist/parse').Composition,
|
||||
multiDockerignore: boolean,
|
||||
changedPathHandler: (serviceName: string, changedPath: string) => void,
|
||||
): Promise<ByService<chokidar.FSWatcher>> {
|
||||
|
@ -17,9 +17,11 @@
|
||||
|
||||
import { expect } from 'chai';
|
||||
|
||||
describe('resin-multibuild consistency', function () {
|
||||
describe('@balena/compose/multibuild consistency', function () {
|
||||
it('should use the same values for selected constants', async () => {
|
||||
const { QEMU_BIN_NAME: MQEMU_BIN_NAME } = await import('resin-multibuild');
|
||||
const { QEMU_BIN_NAME: MQEMU_BIN_NAME } = await import(
|
||||
'@balena/compose/dist/multibuild'
|
||||
);
|
||||
const { QEMU_BIN_NAME } = await import('../../build/utils/qemu');
|
||||
expect(QEMU_BIN_NAME).to.equal(MQEMU_BIN_NAME);
|
||||
});
|
||||
|
30
typings/dockerfile-template/index.d.ts
vendored
30
typings/dockerfile-template/index.d.ts
vendored
@ -1,30 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Balena Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
declare module 'dockerfile-template' {
|
||||
/**
|
||||
* Variables which define what will be replaced, and what they will be replaced with.
|
||||
*/
|
||||
export interface TemplateVariables {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export function process(
|
||||
content: string,
|
||||
variables: TemplateVariables,
|
||||
): string;
|
||||
}
|
Reference in New Issue
Block a user