Skip to content

Commit

Permalink
feat(janus-idp/cli): package-dynamic-plugins default to linux/amd64 p…
Browse files Browse the repository at this point in the history
…latform (#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]>
  • Loading branch information
kadel authored Jan 10, 2025
1 parent eac5451 commit 70cde20
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/silly-nails-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@janus-idp/cli": minor
---
changes to package-dynamic-plugins command:

- by default `--platform linux/amd64` is added to the command container build command
- added a new flag `--platfrom` allow user to specify the platform for the container build command
5 changes: 5 additions & 0 deletions packages/cli/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ export function registerScriptCommand(program: Command) {
'-m, --marketplace-file <file>',
'Marketplace yaml file. This is a Plugin entity definition for Marketplace.',
)
.option(
'--platform <platform>',
'Platform to use when building the container image. Default is "linux/amd64". Can be set to "" to not set --platfrom flag in builder command.',
'linux/amd64',
)
.action(
lazy(() => import('./package-dynamic-plugins').then(m => m.command)),
);
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/commands/package-dynamic-plugins/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function command(opts: OptionValues): Promise<void> {
tag,
useDocker,
marketplaceFile,
platform,
} = opts;
if (!exportTo && !tag) {
Task.error(
Expand Down Expand Up @@ -236,6 +237,9 @@ export async function command(opts: OptionValues): Promise<void> {
`--annotation io.backstage.marketplace/${pluginName}='${base64pluginInfo}'`,
);
}
if (platform) {
flags.push(`--platform ${platform}`);
}
// run the command to generate the image
Task.log(`Creating image using ${containerTool}`);
await Task.forCommand(
Expand Down

0 comments on commit 70cde20

Please sign in to comment.