Skip to content

Commit

Permalink
feat(app): add nexus repo manager plugin to showcase (janus-idp#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaperex committed Sep 14, 2023
1 parent af6f5a2 commit 6d93ba8
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .changeset/hot-ants-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'app': minor
---

The [Nexus Repository Manager](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/nexus-repository-manager) plugin has been added with the <NexusRepositoryManagerPage /> in the Entity Page Image Registry tab.

Since the Nexus Repository Manager plugin requires a proxy endpoint, these changes are required to `app-config.yaml` if you want to add the Nexus Repository Manager plugin. Please read the [README](https://github.com/janus-idp/backstage-showcase/blob/main/README.md) and [Getting Started](https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/getting-started.md) for more details.

```diff
proxy:
# Other proxy configurations...

+ '/nexus-repository-manager':
+ target: ${NEXUS_REPOSITORY_MANAGER_URL}
+ headers:
+ X-Requested-With: 'XMLHttpRequest'
+ # Uncomment the following line to access a private Nexus Repository Manager using a token
+ # Authorization: 'Bearer <NEXUS_REPOSITORY_MANAGER_TOKEN>'
+ changeOrigin: true
+ # Change to "false" in case of using self hosted Nexus Repository Manager instance with a self-signed certificate
+ secure: ${NEXUS_REPOSITORY_MANAGER_SECURE}
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Our current list of plugins within the showcase app include:
- [Dynatrace plugin](https://github.com/backstage/backstage/tree/master/plugins/dynatrace)
- [Gitlab Scaffolder actions](https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend-module-gitlab)
- [Utils Scaffolder actions](https://github.com/RoadieHQ/roadie-backstage-plugins/tree/main/plugins/scaffolder-actions/scaffolder-backend-module-utils)
- [Nexus Repository Manager plugin](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/nexus-repository-manager)

## Getting Started

Expand Down
11 changes: 11 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ proxy:
# For more info on how to generate this token: https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication
Authorization: 'Api-Token ${DYNATRACE_ACCESS_TOKEN}'

# Plugin: Nexus Repository Manager
'/nexus-repository-manager':
target: ${NEXUS_REPOSITORY_MANAGER_URL}
headers:
X-Requested-With: 'XMLHttpRequest'
# Uncomment the following line to access a private Nexus Repository Manager using a token
# Authorization: 'Bearer <NEXUS_REPOSITORY_MANAGER_TOKEN>'
changeOrigin: true
# Change to "false" in case of using self hosted Nexus Repository Manager instance with a self-signed certificate
secure: ${NEXUS_REPOSITORY_MANAGER_SECURE}

# Reference documentation http://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
# and an external cloud storage when deploying TechDocs for production use-case.
Expand Down
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage/plugin-dynatrace": "7.0.3",
"@backstage/app-defaults": "1.4.2",
"@backstage/catalog-model": "1.4.1",
"@backstage/cli": "0.22.12",
Expand All @@ -29,6 +28,7 @@
"@backstage/plugin-catalog-graph": "0.2.35",
"@backstage/plugin-catalog-import": "0.9.13",
"@backstage/plugin-catalog-react": "1.8.3",
"@backstage/plugin-dynatrace": "7.0.3",
"@backstage/plugin-github-actions": "0.6.4",
"@backstage/plugin-github-issues": "0.2.12",
"@backstage/plugin-home": "0.5.7",
Expand All @@ -54,6 +54,7 @@
"@immobiliarelabs/backstage-plugin-gitlab": "6.2.0",
"@janus-idp/backstage-plugin-analytics-provider-segment": "1.1.1",
"@janus-idp/backstage-plugin-jfrog-artifactory": "1.1.2",
"@janus-idp/backstage-plugin-nexus-repository-manager": "1.1.0",
"@janus-idp/backstage-plugin-ocm": "3.2.0",
"@janus-idp/backstage-plugin-quay": "1.3.0",
"@janus-idp/backstage-plugin-tekton": "1.9.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import {
isJfrogArtifactoryAvailable,
} from '@janus-idp/backstage-plugin-jfrog-artifactory';
import { QuayPage, isQuayAvailable } from '@janus-idp/backstage-plugin-quay';
import {
isNexusRepositoryManagerAvailable,
NexusRepositoryManagerPage,
} from '@janus-idp/backstage-plugin-nexus-repository-manager';
import Grid from '@mui/material/Grid';
import React from 'react';

Expand All @@ -24,12 +28,20 @@ export const imageRegistry = (
<QuayPage />
</Grid>
</EntitySwitch.Case>

</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={isJfrogArtifactoryAvailable}>
<Grid item xs={12}>
<JfrogArtifactoryPage />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={isNexusRepositoryManagerAvailable}>
<Grid item xs={12}>
<NexusRepositoryManagerPage />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</Grid>
);
17 changes: 17 additions & 0 deletions showcase-docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,23 @@ The easiest and fastest method for getting started: Backstage Showcase app, runn
oauth2Proxy: {}
```

- Setup the Nexus Repository Manager plugin

- `${NEXUS_REPOSITORY_MANAGER_URL}`: The URL to the Nexus Repository Manager instance.
- `${NEXUS_REPOSITORY_MANAGER_SECURE}`: Change to `false` in case of using self hosted artifactory instance with a self-signed certificate
- If using a private Nexus Repository Manager instance, you will need to add an Authorization header for the nexus proxy in your `app-config.yaml` or `app-config.local.yaml`:

```yaml
'/nexus-repository-manager':
target: ${NEXUS_REPOSITORY_MANAGER_URL}
headers:
X-Requested-With: 'XMLHttpRequest'
# Uncomment the following line to access a private Nexus Repository Manager using a token
Authorization: 'Bearer ${NEXUS_REPOSITORY_MANAGER_TOKEN}'
```

- `${NEXUS_REPOSITORY_MANAGER_TOKEN}` (Only for private Nexus Repository Manager instances): Nexus instance API token (see [documentation](https://help.sonatype.com/repomanager3/nexus-repository-administration/user-authentication/user-tokens)) with `nx-repository-view-*-*-read` [permissions](https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges), or read permissions to view all the repositories you want to display in the plugin.

4. Run `yarn install` to install the dependencies

5. Start the application using `yarn start`
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4958,6 +4958,22 @@
uuid "^9.0.0"
winston "^3.2.1"

"@janus-idp/backstage-plugin-nexus-repository-manager@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@janus-idp/backstage-plugin-nexus-repository-manager/-/backstage-plugin-nexus-repository-manager-1.1.0.tgz#d25075288bdbd83253b564ea7c142bae9acb20e1"
integrity sha512-C20H52Zm3s4YnebCh1IBiVQYb4WjK6KCFr9Gfn8nrmZAjMP2BGDDar1bvq+L0tfe0TmmpJ4CNmEPCPXjFQhelA==
dependencies:
"@backstage/catalog-model" "^1.4.1"
"@backstage/core-components" "^0.13.3"
"@backstage/core-plugin-api" "^1.5.3"
"@backstage/plugin-catalog-react" "^1.8.0"
"@backstage/theme" "^0.4.1"
"@janus-idp/shared-react" "1.3.0"
"@material-ui/core" "^4.9.13"
"@material-ui/icons" "^4.9.1"
"@material-ui/lab" "^4.0.0-alpha.45"
react-use "^17.2.4"

"@janus-idp/backstage-plugin-ocm-backend@3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@janus-idp/backstage-plugin-ocm-backend/-/backstage-plugin-ocm-backend-3.2.1.tgz#33c25d2f7d88e855fa4ed8448007dabc3ca3dff9"
Expand Down

0 comments on commit 6d93ba8

Please sign in to comment.