Skip to content

Commit

Permalink
feat(janus-idp/cli): add --platfrom flag to package-dynamic-plugins
Browse files Browse the repository at this point in the history
this flag overrides default linux/amd64 platform

Signed-off-by: Tomas Kral <[email protected]>
  • Loading branch information
kadel committed Jan 10, 2025
1 parent eac5451 commit 7f1215c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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 7f1215c

Please sign in to comment.