0.3.0 • Published 2 days ago

@backstage/plugin-scaffolder-backend-module-yeoman v0.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 days ago

scaffolder-backend-module-yeoman

Welcome to the run:yeoman action for the scaffolder-backend.

Getting started

You need to configure the action in your backend:

From your Backstage root directory

cd packages/backend
yarn add @backstage/plugin-scaffolder-backend-module-yeoman

Configure the action: (you can check the docs to see all options):

// packages/backend/src/plugins/scaffolder.ts

const actions = [
  createRunYeomanAction(),
  ...createBuiltInActions({
    containerRunner,
    integrations,
    config,
    catalogClient,
    reader,
  }),
];

return await createRouter({
  containerRunner,
  logger,
  config,
  database,
  catalogClient,
  reader,
  actions,
});

After that you can use the action in your template:

apiVersion: backstage.io/v1beta2
kind: Template
metadata:
  name: yeoman-demo
  title: Yeoman Test
  description: Cookiecutter example
spec:
  owner: backstage/techdocs-core
  type: service

  parameters:
    - title: Fill in some steps
      required:
        - name
        - owner
      properties:
        name:
          title: Name
          type: string
          description: Unique name of the component
          ui:autofocus: true
          ui:options:
            rows: 5
        owner:
          title: Owner
          type: string
          description: Owner of the component
          ui:field: OwnerPicker
          ui:options:
            allowedKinds:
              - Group
        system:
          title: System
          type: string
          description: System of the component
          ui:field: EntityPicker
          ui:options:
            allowedKinds:
              - System
            defaultKind: System

    - title: Choose a location
      required:
        - repoUrl
        - dryRun
      properties:
        repoUrl:
          title: Repository Location
          type: string
          ui:field: RepoUrlPicker
          ui:options:
            allowedHosts:
              - github.com
        dryRun:
          title: Only perform a dry run, don't publish anything
          type: boolean
          default: false

  steps:
    - id: yeoman
      name: Yeoman
      action: run:yeoman
      input:
        namespace: 'org:codeowners'
        options:
          codeowners: '@{{ parameters.owner }}'

    - id: publish
      if: '{{ not parameters.dryRun }}'
      name: Publish
      action: publish:github
      input:
        allowedHosts: ['github.com']
        description: 'This is {{ parameters.name }}'
        repoUrl: '{{ parameters.repoUrl }}'

    - id: register
      if: '{{ not parameters.dryRun }}'
      name: Register
      action: catalog:register
      input:
        repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}'
        catalogInfoPath: '/catalog-info.yaml'

    - name: Results
      if: '{{ parameters.dryRun }}'
      action: debug:log
      input:
        listWorkspace: true

  output:
    links:
      - title: Repository
        url: '{{ steps.publish.output.remoteUrl }}'
      - title: Open in catalog
        icon: 'catalog'
        entityRef: '{{ steps.register.output.entityRef }}'

You can also visit the /create/actions route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like.

Yeoman Generators setup

Yeoman generator should be installed a dependency of your backstage/packages/backend in package.json

"generator-name": "^1.2.3"

Alternatively it can be installed globally in the environment using, e.g.: npm install -g generator-name.

0.3.1-next.1

9 days ago

0.3.1-next.0

16 days ago

0.3.0

23 days ago

0.2.38-next.1

1 month ago

0.2.38-next.0

1 month ago

0.2.37

1 month ago

0.2.36

2 months ago

0.2.35

2 months ago

0.2.35-next.2

2 months ago

0.2.35-next.1

2 months ago

0.2.34

2 months ago

0.2.34-next.0

2 months ago

0.2.33

3 months ago

0.2.32

3 months ago

0.2.31

3 months ago

0.2.31-next.3

3 months ago

0.2.31-next.2

3 months ago

0.2.31-next.1

3 months ago

0.2.31-next.0

4 months ago

0.2.30

4 months ago

0.2.30-next.2

4 months ago

0.2.30-next.1

4 months ago

0.2.30-next.0

5 months ago

0.2.29

5 months ago

0.2.29-next.3

5 months ago

0.2.29-next.2

5 months ago

0.2.29-next.1

5 months ago

0.2.24-next.1

8 months ago

0.2.24-next.3

8 months ago

0.2.24-next.2

8 months ago

0.2.21-next.0

10 months ago

0.2.29-next.0

6 months ago

0.2.21-next.2

9 months ago

0.2.21-next.1

9 months ago

0.2.28-next.1

6 months ago

0.2.28-next.0

7 months ago

0.2.28-next.2

6 months ago

0.2.26-next.1

7 months ago

0.2.26-next.0

8 months ago

0.2.27

7 months ago

0.2.26

7 months ago

0.2.25

8 months ago

0.2.24

8 months ago

0.2.23

9 months ago

0.2.22

9 months ago

0.2.21

9 months ago

0.2.20

10 months ago

0.2.23-next.0

9 months ago

0.2.28

6 months ago

0.2.27-next.2

7 months ago

0.2.20-next.0

11 months ago

0.2.19-next.2

11 months ago

0.2.19

11 months ago

0.2.19-next.0

12 months ago

0.2.19-next.1

12 months ago

0.2.18-next.2

1 year ago

0.2.18-next.1

1 year ago

0.2.18

12 months ago

0.2.17-next.3

1 year ago

0.2.18-next.0

1 year ago

0.2.17

1 year ago

0.2.17-next.2

1 year ago

0.2.17-next.0

1 year ago

0.2.17-next.1

1 year ago

0.2.16-next.0

1 year ago

0.2.16-next.1

1 year ago

0.2.16-next.2

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.13-next.2

1 year ago

0.2.13-next.1

1 year ago

0.2.15-next.1

1 year ago

0.2.15-next.0

1 year ago

0.2.15-next.2

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.13-next.0

1 year ago

0.2.11-next.1

2 years ago

0.2.11-next.0

2 years ago

0.2.11-next.2

2 years ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

2 years ago

0.2.12-next.1

1 year ago

0.2.12-next.2

1 year ago

0.2.12-next.3

1 year ago

0.2.12-next.0

1 year ago

0.2.10-next.2

2 years ago

0.2.10-next.1

2 years ago

0.2.10-next.0

2 years ago

0.2.9-next.1

2 years ago

0.2.9-next.0

2 years ago

0.2.9

2 years ago

0.2.8-next.0

2 years ago

0.2.7-next.0

2 years ago

0.2.6-next.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.8

2 years ago

0.2.5-next.0

2 years ago

0.2.5-next.1

2 years ago

0.2.5

2 years ago

0.2.4-next.0

2 years ago

0.2.4-next.1

2 years ago

0.2.2-next.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.4

2 years ago

0.1.5-next.0

2 years ago

0.1.4-next.0

2 years ago

0.1.3-next.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago