@digital-ai/plugin-scaffolder-frontend-module-deploy-app-field
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.2 • Public • Published

scaffolder-frontend-module-deploy-app-field

Welcome to the scaffolder-frontend-module-deploy-app-field plugin!

This plugin is a Custom Field Extension for Backstage. It allows you to add a set of drop-down lists to pick a Application already available in deploy. It interacts with the configured Deploy Host to load the list of available Application from Deploy.

Preview

Deploy Application Selector Custom Field Extension Preview

Installation

From your Backstage instance root folder:

yarn add --cwd packages/app @digital-ai/plugin-scaffolder-frontend-module-deploy-app-field

Configuration

  1. Add the import to your packages/app/src/App.tsx on the frontend package of your Backstage instance:
// packages/app/src/App.tsx

import { DeployApplicationSelectorFieldExtension } from '@digital-ai/plugin-scaffolder-frontend-module-deploy-app-field';
import { ScaffolderFieldExtensions } from '@backstage/plugin-scaffolder-react';
  1. Then add the imported field extension as a child of ScaffolderFieldExtensions inside Route, like so:
// packages/app/src/App.tsx

<Route path="/create" element={<ScaffolderPage />}>
  <ScaffolderFieldExtensions>
    <DeployApplicationSelectorFieldExtension />
  </ScaffolderFieldExtensions>
</Route>
  1. This custom field extension populates the dropdown list with applications from XL-Deploy, which is expected to be proxied by Backstage at the following path: /deploy-app. As such, you need to add the appropriate configuration to your app-config.yaml file under the proxy.endpoints field, like so:
# app-config.yaml

proxy:
  /deploy-app:
    target: http://localhost:4516/
    changeOrigin: true
    headers:
      Authorization: Basic YWRtaW46YWRtaW4=

You should now see the custom field DeployApplicationSelectorFieldExtension and its dropdown lists populated if you navigate to the Template Editor page at http://localhost:3000/create/edit.

Usage

To use the extension in a Backstage Software Template, you can add the ui:field field to the parameter. The output of the extension is an object made up of the following fields:

  • deployApplication: the Application name selected by the user.
  parameters:
    - title:  Select Deploy Application
      required:
        - deploy
      properties:
        deploy:
          type: object
          properties:
            deployApplication:
              type: string
          ui:field: DeployApplicationeSelectorExtension
          ui:autofocus: true

Package Sidebar

Install

npm i @digital-ai/plugin-scaffolder-frontend-module-deploy-app-field

Homepage

digital.ai/

Weekly Downloads

10

Version

0.0.1-alpha.2

License

Apache-2.0

Unpacked Size

19.1 kB

Total Files

12

Last publish

Collaborators

  • gvolarevic-dai
  • agavaldas
  • msnively
  • jcaldas
  • geekzoo-dai
  • dai-npmjs-bot
  • grantcroker-dai