Skip to content

Commit

Permalink
Add --note option for push and deploy
Browse files Browse the repository at this point in the history
Change-type: minor
Signed-off-by: Matthew Yarmolinsky <matthew-timothy@balena.io>
  • Loading branch information
myarmolinsky committed Jul 14, 2022
1 parent a92f581 commit 18eedfe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/balena-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,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

Expand Down Expand Up @@ -2848,6 +2849,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
Expand Down Expand Up @@ -3213,6 +3218,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"

Expand Down Expand Up @@ -3253,6 +3259,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
Expand Down
6 changes: 6 additions & 0 deletions lib/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags {
nologupload: boolean;
'release-tag'?: string[];
draft: boolean;
note?: string;
help: void;
}

Expand Down Expand Up @@ -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"',
];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -231,6 +234,9 @@ ${dockerignoreHelp}
releaseTagKeys,
releaseTagValues,
);
if (options.note) {
await sdk.models.release.note(release.id, options.note);
}
}

async deployProject(
Expand Down
6 changes: 6 additions & 0 deletions lib/commands/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface FlagsDef {
'multi-dockerignore': boolean;
'release-tag'?: string[];
draft: boolean;
note?: string;
help: void;
}

Expand Down Expand Up @@ -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',
'',
Expand Down Expand Up @@ -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,
};

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 18eedfe

Please sign in to comment.