diff --git a/.changeset/silly-nails-smell.md b/.changeset/silly-nails-smell.md new file mode 100644 index 0000000000..a957efb953 --- /dev/null +++ b/.changeset/silly-nails-smell.md @@ -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 diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index d3ca004a12..8fd9a336b8 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -190,6 +190,11 @@ export function registerScriptCommand(program: Command) { '-m, --marketplace-file ', 'Marketplace yaml file. This is a Plugin entity definition for Marketplace.', ) + .option( + '--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)), ); diff --git a/packages/cli/src/commands/package-dynamic-plugins/command.ts b/packages/cli/src/commands/package-dynamic-plugins/command.ts index d2942bfd3a..d760a6a67f 100644 --- a/packages/cli/src/commands/package-dynamic-plugins/command.ts +++ b/packages/cli/src/commands/package-dynamic-plugins/command.ts @@ -20,6 +20,7 @@ export async function command(opts: OptionValues): Promise { tag, useDocker, marketplaceFile, + platform, } = opts; if (!exportTo && !tag) { Task.error( @@ -236,6 +237,9 @@ export async function command(opts: OptionValues): Promise { `--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(