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

docs: update showcase-docs to be compatible with Docusaurus #838

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
167 changes: 86 additions & 81 deletions showcase-docs/dynamic-plugins.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Dynamic Plugins support
---
title: Dynamic Plugins
custom_edit_url: https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/dynamic-plugins.md
tags:
- Dynamic Plugins
---

## Overview

Expand All @@ -25,91 +30,91 @@ So there are some changes to be made to the plugin code, in order to make it com

1. The plugin must:

- import the `@backstage/backend-plugin-manager` package, as an alias to `janus-idp/backend-plugin-manager@v1.19.6` package,
- add the `@janus-idp/cli` dependency, which provides a new, required, `export-dynamic-plugin` command.
- add the `export-dynamic` script entry,
- add the following elements to the package `files` list:

`"dist-dynamic/*.*", "dist-dynamic/dist/**", "dist-dynamic/alpha/*"`

These recommended changes to the `package.json` are summarized below:

```json
...
"scripts": {
...
"export-dynamic": "janus-cli package export-dynamic-plugin"
...
},
...
"dependencies": {
...
"@backstage/backend-plugin-manager": "npm:@janus-idp/backend-plugin-manager@v1.19.6",
...
}
...
"devDependencies": {
"@janus-idp/cli": "1.4.3"
},
...
"files": [
...
"dist-dynamic/*.*",
"dist-dynamic/dist/**",
"dist-dynamic/alpha/*"
],
```
- import the `@backstage/backend-plugin-manager` package, as an alias to `janus-idp/backend-plugin-manager@v1.19.6` package,
- add the `@janus-idp/cli` dependency, which provides a new, required, `export-dynamic-plugin` command.
- add the `export-dynamic` script entry,
- add the following elements to the package `files` list:

`"dist-dynamic/*.*", "dist-dynamic/dist/**", "dist-dynamic/alpha/*"`

These recommended changes to the `package.json` are summarized below:

```json
...
"scripts": {
...
"export-dynamic": "janus-cli package export-dynamic-plugin"
...
},
...
"dependencies": {
...
"@backstage/backend-plugin-manager": "npm:@janus-idp/backend-plugin-manager@v1.19.6",
...
}
...
"devDependencies": {
"@janus-idp/cli": "1.4.3"
},
...
"files": [
...
"dist-dynamic/*.*",
"dist-dynamic/dist/**",
"dist-dynamic/alpha/*"
],
```

2. A `src/dynamic/index.ts` file must be added, and must export a named entry point (`dynamicPluginInstaller`) of a specific type (`BackendDynamicPluginInstaller`) that will contain the code of the plugin wiring:

```ts
import { BackendDynamicPluginInstaller } from '@backstage/backend-plugin-manager';

export const dynamicPluginInstaller: BackendDynamicPluginInstaller = {
kind: 'legacy',

// Contributions of the plugin to the application.
// Here optional fields allow embedding the code which is usually described in the plugin readme for manual addition.
// If a contribution is not used, the field should be omitted.

router: {
pluginID: 'router plugin ID, used as REST endpoint suffix',
createPlugin(env) {
// Return a promise to your router.
return Promise.reject(new Error('Not implemented'));
},
},

events(eventsBackend, env) {
// Do something with the events backend (add subscribers or publishers)
// and return a list of HttpPostIngressOptions that will be
// registered with the http event endpoint.
return [];
},

catalog(builder, env) {
// Add catalog contributions, such as
// entity providers or location analyzers.
},

scaffolder(env) {
// Return an array of scaffolder actions (TemplateAction)
// that will be registered with the scaffolder.
return [];
},

search(indexBuilder, schedule, env) {
// Add search contributions, such as
// collators and decorators.
},
};
```
```ts
import { BackendDynamicPluginInstaller } from '@backstage/backend-plugin-manager';

export const dynamicPluginInstaller: BackendDynamicPluginInstaller = {
kind: 'legacy',

// Contributions of the plugin to the application.
// Here optional fields allow embedding the code which is usually described in the plugin readme for manual addition.
// If a contribution is not used, the field should be omitted.

router: {
pluginID: 'router plugin ID, used as REST endpoint suffix',
createPlugin(env) {
// Return a promise to your router.
return Promise.reject(new Error('Not implemented'));
},
},

events(eventsBackend, env) {
// Do something with the events backend (add subscribers or publishers)
// and return a list of HttpPostIngressOptions that will be
// registered with the http event endpoint.
return [];
},

catalog(builder, env) {
// Add catalog contributions, such as
// entity providers or location analyzers.
},

scaffolder(env) {
// Return an array of scaffolder actions (TemplateAction)
// that will be registered with the scaffolder.
return [];
},

search(indexBuilder, schedule, env) {
// Add search contributions, such as
// collators and decorators.
},
};
```

3. The `dynamicPluginInstaller` entry point must be exported in the main `src/index.ts` file:

```ts
export * from './dynamic/index';
```
```ts
export * from './dynamic/index';
```

#### Note about the new backend system support

Expand Down Expand Up @@ -352,7 +357,7 @@ The showcase docker image comes pre-loaded with a selection of dynamic plugins,

Upon application startup, for each plugin that is disabled by default, the `install-dynamic-plugins` init container within the `backstage` Pod's log will display a line similar to the following:

```
```console
======= Skipping disabled dynamic plugin ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic
```

Expand Down
13 changes: 9 additions & 4 deletions showcase-docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Getting Started running Backstage Showcase
---
title: Getting Started
custom_edit_url: https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/getting-started.md
tags:
- Getting Started
---

There are several different methods for running the Backstage Showcase app today. We currently have support for running the application locally, using a helm chart to deploy to a cluster, and manifests for deployment using ArgoCD.

Expand All @@ -19,7 +24,7 @@ The easiest and fastest method for getting started: Backstage Showcase app, runn

4. Start the application using `yarn start`

5. Navigate to <http://localhost:3000>
5. Navigate to [http://localhost:3000](http://localhost:3000)

## Running Locally with the Optional Plugins

Expand Down Expand Up @@ -48,7 +53,7 @@ The easiest and fastest method for getting started: Backstage Showcase app, runn

- Set your Organization Name

- ${ORGANIZATION_NAME}: organization name
- `${ORGANIZATION_NAME}`: organization name

- Enable plugins (All plugins have a default of `false`)

Expand Down Expand Up @@ -217,7 +222,7 @@ The easiest and fastest method for getting started: Backstage Showcase app, runn

6. Start the application using `yarn start`

7. Navigate to <http://localhost:3000>
7. Navigate to [http://localhost:3000](http://localhost:3000)

## Running with Helm

Expand Down
15 changes: 10 additions & 5 deletions showcase-docs/helm-chart.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
**WARNING**

---
title: Helm Chart
custom_edit_url: https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/helm-chart.md
tags:
- Helm Chart
---

:::warning
This documentation is currently out of date

# Setting up to use the Helm Chart
:::

The Helm Chart that this project is currently using is the Backstage Helm Chart. This Helm Chart is used to simplify the process of deploying the Backstage Showcase app to a Kubernetes cluster. For more information on the Backstage Helm Chart consult the [official documentation](https://github.com/backstage/charts).

Expand Down Expand Up @@ -69,7 +74,7 @@ This guide will have a focus deploying to an OpenShift cluster as that is the ma
oc port-forward -n backstage svc/backstage 7007:7007
```

1. The app can be accessed at <http://localhost:7007>
1. The app can be accessed at [http://localhost:7007](http://localhost:7007)

## Additional Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Setting up Metrics Monitoring and Logging for Backstage Showcase
---
title: Metrics Monitoring and Logging
custom_edit_url: https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/metrics-monitoring-and-logging.md
tags:
- Metrics Monitoring
- Logging
---

The Backstage Showcase provides a `/metrics` endpoint that provides Prometheus metrics about your backstage application. This endpoint can be used to monitor your backstage instance using Prometheus and Grafana.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Customizing the look of your showcase instance
---
title: UI Customization
custom_edit_url: https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/ui-customization.md
tags:
- Customization
---

To customize the look of your showcase instance, you can edit the `app-config.yaml` file in the root of this repository. The customizations used to configure the app are loaded by the backstage app at startup, with certain values being queried by the app at runtime.

Expand Down