0.2.3 • Published 7 months ago

@scott-the-programmer/backstage-plugin-spacelift-backend v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Spacelift Backstage Plugins

Maintainability

backstage-plugin-spacelift: npm version

backstage-plugin-spacelift-backend: npm version

An unofficial Backstage plugin for Spacelift to view statuses of runs and stacks through Backstage

This repository contains two Backstage plugins for integrating with the Spacelift platform:

  • spacelift: a plugin that displays a table of all Spacelift stacks and runs
  • spacelift-backend: a plugin that provides a simple wrapper for the Spacelift API.

Disclaimer: I do not work for Spacelift.io. I am simply interested in the tool and want to make a part of it accessible by backstage

Stacks

Runs

Installation

To use these plugins, you'll first need to install them in your Backstage app.

yarn add @scott-the-programmer/backstage-plugin-spacelift @scott-the-programmer/backstage-plugin-spacelift-backend

Backend

Create the following file under packages/backend/src/plugins/spacelift.ts

import { createRouter } from '@scott-the-programmer/backstage-plugin-spacelift-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin({
  logger,
  config,
}: PluginEnvironment): Promise<Router> {
  return await createRouter({ logger: logger, config: config });
}

Add the following snippets to packages/backend/src/index.ts

import spacelift from './plugins/spacelift';
...
const spaceliftEnv = useHotMemoize(module, () => createEnv('spacelift'));
...
  apiRouter.use('/spacelift', await spacelift(spaceliftEnv));

Frontend

Add the following snippets to packages/app/src/App.tsx

import { SpaceliftPage } from '@scott-the-programmer/backstage-plugin-spacelift';
...
<Route path="/spacelift" element={<SpaceliftPage />} />

Add the following snippets to Root.tsx to add spacelift to the home sidebar

<SidebarItem icon={LibraryBooks} to="spacelift" text="Spacelift" />

Config

Add the following config to your app-config.yaml

spacelift:
  org: your-spacelift-org
  id: your-spacelift-id
  secret: your-spacelift-secret

Contributing

Feel free to contribute to this project in any shape or form, whether it's raising issues, feature requests, or even creating PRs yourself.

Any help is appreciated!

Install Dependencies

Install the frontend dependencies:

make install-frontend

Install the backend dependencies:

make install-backend

Development

Run the frontend development server:

make run-frontend

Run the backend development server:

make run-backend

Testing and Linting Run the frontend tests:

make test-frontend

Run the backend tests:

make test-backend
0.2.3

7 months ago

0.2.2

7 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.5

11 months ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago