Skip to content

Commit 8c307f7

Browse files
authored
feat(janus-idp/cli): remove marketplace flag (#2617)
* package-dynamic-plugins: remove --marketplace flag fix formating * add changeset
1 parent f7b2765 commit 8c307f7

File tree

3 files changed

+9
-37
lines changed

3 files changed

+9
-37
lines changed

.changeset/shiny-snakes-tan.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@janus-idp/cli": major
3+
---
4+
5+
changes to `package-dynamic-plugins` command:
6+
7+
- Removed `-m` (`--marketplace`) flag. This flag will be replaced with more generic implementation see: https://issues.redhat.com/browse/RHIDP-5290

packages/cli/src/commands/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ export function registerScriptCommand(program: Command) {
186186
'By defult, the command uses podman to build the container image. Use this flag to use docker instead.',
187187
false,
188188
)
189-
.option(
190-
'-m, --marketplace-file <file>',
191-
'Marketplace yaml file. This is a Plugin entity definition for Marketplace.',
192-
)
193189
.option(
194190
'--platform <platform>',
195191
'Platform to use when building the container image. Default is "linux/amd64". Can be set to "" to not set --platfrom flag in builder command.',

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

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,8 @@ import { paths } from '../../lib/paths';
1313
import { Task } from '../../lib/tasks';
1414

1515
export async function command(opts: OptionValues): Promise<void> {
16-
const {
17-
exportTo,
18-
forceExport,
19-
preserveTempDir,
20-
tag,
21-
useDocker,
22-
marketplaceFile,
23-
platform,
24-
} = opts;
16+
const { exportTo, forceExport, preserveTempDir, tag, useDocker, platform } =
17+
opts;
2518
if (!exportTo && !tag) {
2619
Task.error(
2720
`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`,
@@ -40,19 +33,6 @@ export async function command(opts: OptionValues): Promise<void> {
4033
return;
4134
}
4235
}
43-
const maketplaceInfo: Object[] = [];
44-
if (marketplaceFile) {
45-
if (!fs.existsSync(marketplaceFile)) {
46-
Task.error(`Marketplace file ${marketplaceFile} does not exist`);
47-
return;
48-
}
49-
const yamlDocuments = YAML.parseAllDocuments(
50-
fs.readFileSync(marketplaceFile).toLocaleString(),
51-
);
52-
for (const document of yamlDocuments) {
53-
maketplaceInfo.push(document.toJS());
54-
}
55-
}
5636
const workspacePackage = (await fs.readJson(
5737
paths.resolveTarget('package.json'),
5838
)) as PackageJson;
@@ -226,17 +206,6 @@ export async function command(opts: OptionValues): Promise<void> {
226206
const flags = [
227207
`--annotation io.backstage.dynamic-packages='${Buffer.from(JSON.stringify(pluginRegistryMetadata)).toString('base64')}'`,
228208
];
229-
230-
for (const pluginInfo of maketplaceInfo) {
231-
const base64pluginInfo = Buffer.from(
232-
JSON.stringify(pluginInfo),
233-
).toString('base64');
234-
const pluginName = (pluginInfo as { metadata: { name: string } })
235-
.metadata.name;
236-
flags.push(
237-
`--annotation io.backstage.marketplace/${pluginName}='${base64pluginInfo}'`,
238-
);
239-
}
240209
if (platform) {
241210
flags.push(`--platform ${platform}`);
242211
}

0 commit comments

Comments
 (0)