Skip to content

Commit 638b35b

Browse files
authored
BlackDuck Scaffolder - Project creation action (#1885)
* blackduck scaffolder - project creation action Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * fixed scaffolder module package.json Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * Review comments fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * package & template fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * API Report fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * added blackduck-node library Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * Updated project creation request Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * API Reports fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * dependencies fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * changeset updated Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * yarn packages & api reports fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * fixed yarn.lock Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * yarn package & review comments are fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * changeset updated Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * changeset updated and review comments fixed Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * fixed package & dependencies issues Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> --------- Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com>
1 parent aa488b9 commit 638b35b

File tree

35 files changed

+1642
-239
lines changed

35 files changed

+1642
-239
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@backstage-community/plugin-scaffolder-backend-module-blackduck': patch
3+
'@backstage-community/plugin-blackduck-common': patch
4+
'@backstage-community/plugin-blackduck-node': patch
5+
---
6+
7+
Implemented blackduck scaffolder - project creation action.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@backstage-community/plugin-blackduck-backend': patch
3+
---
4+
5+
Added `@backstage-community/plugin-blackduck-node` as dependency
6+
7+
**BREAKING** `BlackDuckConfig` & `BlackDuckHostConfig` are moved to `@backstage-community/plugin-blackduck-node` package.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: scaffolder.backstage.io/v1beta3
2+
kind: Template
3+
metadata:
4+
name: blackduck-create-project
5+
title: Blackduck Template to Create Project
6+
description: Template to create projects in BlackDuck instance
7+
spec:
8+
owner: guests
9+
type: service
10+
11+
parameters:
12+
- title: Provide informance to create project
13+
required:
14+
- projectName
15+
properties:
16+
projectName:
17+
title: Name
18+
type: string
19+
description: Unique name of the project
20+
projectVersion:
21+
title: Version
22+
type: string
23+
description: 'Ex: v1, main, v1-alpha'
24+
versionPhase:
25+
title: Version Phase
26+
type: string
27+
description: 'Ex: DEV, QA, Prod'
28+
versionDistribution:
29+
title: Distribution
30+
type: string
31+
description: 'Ex: Internal, External'
32+
instanceName:
33+
title: Instance Name
34+
type: string
35+
description: Name of the blackduck instance
36+
default: default
37+
enum:
38+
- default
39+
- instanceA
40+
enumNames:
41+
- Default
42+
- Instance A
43+
steps:
44+
- id: blackduck-create-project
45+
name: Blackduck Create Project
46+
action: blackduck:create:project
47+
input:
48+
projectName: ${{parameters.projectName}}
49+
instanceName: ${{parameters.instanceName}}

workspaces/blackduck/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,8 @@
6060
"*.{json,md}": [
6161
"prettier --write"
6262
]
63+
},
64+
"dependencies": {
65+
"knip": "^5.27.4"
6366
}
6467
}

workspaces/blackduck/packages/backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@backstage-community/plugin-blackduck-backend": "workspace:^",
25+
"@backstage-community/plugin-scaffolder-backend-module-blackduck": "workspace:^",
2526
"@backstage/backend-defaults": "^0.7.0",
2627
"@backstage/catalog-client": "^1.9.1",
2728
"@backstage/config": "^1.3.2",

workspaces/blackduck/packages/backend/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ backend.add(import('@backstage/plugin-search-backend'));
4646
backend.add(import('@backstage/plugin-search-backend-module-catalog'));
4747
backend.add(import('@backstage/plugin-search-backend-module-techdocs'));
4848

49+
// blackduck plugin & scaffolder module
4950
backend.add(import('@backstage-community/plugin-blackduck-backend'));
51+
backend.add(
52+
import('@backstage-community/plugin-scaffolder-backend-module-blackduck'),
53+
);
5054

5155
backend.start();

workspaces/blackduck/plugins/blackduck-backend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"pluginPackages": [
2121
"@backstage-community/plugin-blackduck",
2222
"@backstage-community/plugin-blackduck-backend",
23-
"@backstage-community/plugin-blackduck-common"
23+
"@backstage-community/plugin-blackduck-common",
24+
"@backstage-community/plugin-blackduck-node"
2425
]
2526
},
2627
"scripts": {
@@ -34,6 +35,7 @@
3435
},
3536
"dependencies": {
3637
"@backstage-community/plugin-blackduck-common": "workspace:^",
38+
"@backstage-community/plugin-blackduck-node": "workspace:^",
3739
"@backstage/backend-defaults": "^0.7.0",
3840
"@backstage/backend-plugin-api": "^1.1.1",
3941
"@backstage/config": "^1.3.2",

workspaces/blackduck/plugins/blackduck-backend/report.api.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,6 @@
44
55
```ts
66
import { BackendFeature } from '@backstage/backend-plugin-api';
7-
import { Config } from '@backstage/config';
8-
9-
// @public
10-
export class BlackDuckConfig {
11-
constructor(hosts: BlackDuckHostConfig[], defaultHost: string);
12-
// (undocumented)
13-
static fromConfig(config: Config): BlackDuckConfig;
14-
// (undocumented)
15-
getHostConfigByName(name: string): BlackDuckHostConfig;
16-
}
17-
18-
// @public (undocumented)
19-
export interface BlackDuckHostConfig {
20-
// (undocumented)
21-
host: string;
22-
// (undocumented)
23-
name: string;
24-
// (undocumented)
25-
token: string;
26-
}
277

288
// @public
299
const blackduckPlugin: BackendFeature;

workspaces/blackduck/plugins/blackduck-backend/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414
* limitations under the License.
1515
*/
1616
export * from './service/router';
17-
export { BlackDuckConfig } from './service/BlackDuckConfig';
18-
export type { BlackDuckHostConfig } from './service/BlackDuckConfig';
1917
export { blackduckPlugin as default } from './plugin';

workspaces/blackduck/plugins/blackduck-backend/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
coreServices,
1818
createBackendPlugin,
1919
} from '@backstage/backend-plugin-api';
20-
import { BlackDuckConfig } from './service/BlackDuckConfig';
20+
import { BlackDuckConfig } from '@backstage-community/plugin-blackduck-node';
2121
import { createRouter } from './service/router';
2222

2323
/**

0 commit comments

Comments
 (0)