Skip to content

Commit 70cde20

Browse files
authored
feat(janus-idp/cli): package-dynamic-plugins default to linux/amd64 platform (#2613)
* feat(janus-idp/cli): add --platfrom flag to package-dynamic-plugins this flag overrides default linux/amd64 platform Signed-off-by: Tomas Kral <[email protected]> * add changeset --------- Signed-off-by: Tomas Kral <[email protected]>
1 parent eac5451 commit 70cde20

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.changeset/silly-nails-smell.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@janus-idp/cli": minor
3+
---
4+
changes to package-dynamic-plugins command:
5+
6+
- by default `--platform linux/amd64` is added to the command container build command
7+
- added a new flag `--platfrom` allow user to specify the platform for the container build command

packages/cli/src/commands/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ export function registerScriptCommand(program: Command) {
190190
'-m, --marketplace-file <file>',
191191
'Marketplace yaml file. This is a Plugin entity definition for Marketplace.',
192192
)
193+
.option(
194+
'--platform <platform>',
195+
'Platform to use when building the container image. Default is "linux/amd64". Can be set to "" to not set --platfrom flag in builder command.',
196+
'linux/amd64',
197+
)
193198
.action(
194199
lazy(() => import('./package-dynamic-plugins').then(m => m.command)),
195200
);

packages/cli/src/commands/package-dynamic-plugins/command.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export async function command(opts: OptionValues): Promise<void> {
2020
tag,
2121
useDocker,
2222
marketplaceFile,
23+
platform,
2324
} = opts;
2425
if (!exportTo && !tag) {
2526
Task.error(
@@ -236,6 +237,9 @@ export async function command(opts: OptionValues): Promise<void> {
236237
`--annotation io.backstage.marketplace/${pluginName}='${base64pluginInfo}'`,
237238
);
238239
}
240+
if (platform) {
241+
flags.push(`--platform ${platform}`);
242+
}
239243
// run the command to generate the image
240244
Task.log(`Creating image using ${containerTool}`);
241245
await Task.forCommand(

0 commit comments

Comments
 (0)