0.1.2 • Published 1 year ago

@fmenesesg/backstage-plugin-quay-backend v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

plugin-quay-backend

Welcome to the plugin-quay-backend backend plugin! This plugin will show information about your docker images within quay

This plugin was created through the Backstage CLI

Getting started

Enabling backend

cd packages/backend
yarn add @fmenesesg/backstage-plugin-quay-backend

Create a new file named packages/backend/src/plugins/quay.ts, and add the following to it

import { createRouter } from '@fmenesesg/backstage-plugin-quay-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

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

And finally, wire this into the overall backend router. Edit packages/backend/src/index.ts

import harbor from './plugins/quay';
// ...
async function main() {
  // ...
  const quayEnv = useHotMemoize(module, () => createEnv('quay'));
  // ...
  apiRouter.use('/quay', await quay(quayEnv));

Configuration

The plugin requires configuration in the Backstage app-config.yaml to connect to quay API.

quay:
  baseUrl: https://quay.io 
  # https://docs.quay.io/api/ 
  token: OAuth-2-Access-Token

Adding annotations and values to your component file.

apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: sample-system
  description: "A sample system"
  annotations:
    quay.io/repository-slug: organization/repository