Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(janus-idp/cli): remove marketplace flag #2617

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/shiny-snakes-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@janus-idp/cli": major
---

changes to `package-dynamic-plugins` command:

- Removed `-m` (`--marketplace`) flag. This flag will be replaced with more generic implementation see: https://issues.redhat.com/browse/RHIDP-5290
4 changes: 0 additions & 4 deletions packages/cli/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ export function registerScriptCommand(program: Command) {
'By defult, the command uses podman to build the container image. Use this flag to use docker instead.',
false,
)
.option(
'-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.',
Expand Down
35 changes: 2 additions & 33 deletions packages/cli/src/commands/package-dynamic-plugins/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ import { paths } from '../../lib/paths';
import { Task } from '../../lib/tasks';

export async function command(opts: OptionValues): Promise<void> {
const {
exportTo,
forceExport,
preserveTempDir,
tag,
useDocker,
marketplaceFile,
platform,
} = opts;
const { exportTo, forceExport, preserveTempDir, tag, useDocker, platform } =
opts;
if (!exportTo && !tag) {
Task.error(
`Neither ${chalk.white('--export-to')} or ${chalk.white('--tag')} was specified, either specify ${chalk.white('--export-to')} to export plugins to a directory or ${chalk.white('--tag')} to export plugins to a container image`,
Expand All @@ -40,19 +33,6 @@ export async function command(opts: OptionValues): Promise<void> {
return;
}
}
const maketplaceInfo: Object[] = [];
if (marketplaceFile) {
if (!fs.existsSync(marketplaceFile)) {
Task.error(`Marketplace file ${marketplaceFile} does not exist`);
return;
}
const yamlDocuments = YAML.parseAllDocuments(
fs.readFileSync(marketplaceFile).toLocaleString(),
);
for (const document of yamlDocuments) {
maketplaceInfo.push(document.toJS());
}
}
const workspacePackage = (await fs.readJson(
paths.resolveTarget('package.json'),
)) as PackageJson;
Expand Down Expand Up @@ -226,17 +206,6 @@ export async function command(opts: OptionValues): Promise<void> {
const flags = [
`--annotation io.backstage.dynamic-packages='${Buffer.from(JSON.stringify(pluginRegistryMetadata)).toString('base64')}'`,
];

for (const pluginInfo of maketplaceInfo) {
const base64pluginInfo = Buffer.from(
JSON.stringify(pluginInfo),
).toString('base64');
const pluginName = (pluginInfo as { metadata: { name: string } })
.metadata.name;
flags.push(
`--annotation io.backstage.marketplace/${pluginName}='${base64pluginInfo}'`,
);
}
if (platform) {
flags.push(`--platform ${platform}`);
}
Expand Down
Loading