0.4.34 • Published 2 days ago

@backstage/plugin-scaffolder-backend-module-rails v0.4.34

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

scaffolder-backend-module-rails

Welcome to the Rails Module for Scaffolder.

Here you can find all Rails related features to improve your scaffolder:

  • Rails Action to use the new command
  • More features are coming

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-rails

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

const actions = [
  createFetchRailsAction({
    integrations,
    reader,
    containerRunner,
  }),
];

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: rails-demo
  title: Rails template
  description: scaffolder Rails app
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
        railsArguments:
          title: arguments to run the rails new command
          type: object
          properties:
            minimal:
              title: minimal
              description: Preconfigure a minimal rails app
              type: boolean
            skipBundle:
              title: skipBundle
              description: Don't run bundle install
              type: boolean
            skipWebpackInstall:
              title: skipWebpackInstall
              description: Don't run Webpack install
              type: boolean
            api:
              title: api
              description: Preconfigure smaller stack for API only apps
              type: boolean
            template:
              title: template
              description: Path to some application template (can be a filesystem path or URL)
              type: string
              default: './rails-template-file.rb'
            webpacker:
              title: webpacker
              description:
                'Preconfigure Webpack with a particular framework (options: react,
                vue, angular, elm, stimulus)'
              type: string
              enum:
                - react
                - vue
                - angular
                - elm
                - stimulus
            database:
              title: database
              description: 'Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)'
              type: string
              enum:
                - mysql
                - postgresql
                - sqlite3
                - oracle
                - sqlserver
                - jdbcmysql
                - jdbcsqlite3
                - jdbcpostgresql
                - jdbc
            railsVersion:
              title: Rails version in Gemfile
              description:
                'Set up the application with Gemfile pointing to a specific version
                (options: dev, edge, master)'
              type: string
              enum:
                - dev
                - edge
                - master

  steps:
    - id: fetch-base
      name: Fetch Base
      action: fetch:rails
      input:
        url: ./template
        values:
          name: '{{ parameters.name }}'
          owner: '{{ parameters.owner }}'
          system: '{{ parameters.system }}'
          railsArguments: '{{ json parameters.railsArguments }}'

    - name: Write Catalog information
      action: catalog:write
      input:
        component:
          apiVersion: 'backstage.io/v1alpha1'
          kind: Component
          metadata:
            name: '{{ parameters.name }}'
            annotations:
              github.com/project-slug: '{{ projectSlug parameters.repoUrl }}'
          spec:
            type: service
            lifecycle: production
            owner: '{{ 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 }}'

What you need to run that action

The environment need to have a rails installation, or you can build and provide a docker image in your template.

We have a Dockerfile that you can use to build your image.

If you choose to provide a docker image, you need to update your template with imageName parameter:

steps:
  - id: fetch-base
    name: Fetch Base
    action: fetch:rails
    input:
      url: ./template
      imageName: repository/rails:tag
      values:
        name: '{{ parameters.name }}'
        owner: '{{ parameters.owner }}'
        system: '{{ parameters.system }}'
        railsArguments: '{{ json parameters.railsArguments }}'
0.4.35-next.2

2 days ago

0.4.35-next.1

9 days ago

0.4.35-next.0

16 days ago

0.4.34

23 days ago

0.4.34-next.1

1 month ago

0.4.34-next.0

1 month ago

0.4.33

1 month ago

0.4.32

2 months ago

0.4.31

2 months ago

0.4.31-next.2

2 months ago

0.4.31-next.1

2 months ago

0.4.30

2 months ago

0.4.30-next.0

2 months ago

0.4.28

3 months ago

0.4.29

3 months ago

0.4.27

3 months ago

0.4.27-next.3

3 months ago

0.4.27-next.2

3 months ago

0.4.27-next.1

3 months ago

0.4.27-next.0

4 months ago

0.4.26

4 months ago

0.4.26-next.2

4 months ago

0.4.26-next.1

4 months ago

0.4.26-next.0

5 months ago

0.4.25

5 months ago

0.4.25-next.3

5 months ago

0.4.25-next.2

5 months ago

0.4.25-next.1

5 months ago

0.4.25-next.0

6 months ago

0.4.20-next.1

8 months ago

0.4.20-next.3

8 months ago

0.4.20-next.2

8 months ago

0.4.19-next.0

9 months ago

0.4.20

8 months ago

0.4.21

8 months ago

0.4.24

6 months ago

0.4.22

7 months ago

0.4.23

7 months ago

0.4.19

9 months ago

0.4.17

9 months ago

0.4.18

9 months ago

0.4.16

10 months ago

0.4.22-next.0

8 months ago

0.4.22-next.1

7 months ago

0.4.17-next.1

9 months ago

0.4.17-next.0

10 months ago

0.4.17-next.2

9 months ago

0.4.24-next.0

7 months ago

0.4.24-next.1

6 months ago

0.4.24-next.2

6 months ago

0.4.23-next.2

7 months ago

0.4.16-next.1

10 months ago

0.4.16-next.0

11 months ago

0.4.15-next.3

11 months ago

0.4.15-next.2

11 months ago

0.4.15

11 months ago

0.4.15-next.1

12 months ago

0.4.15-next.0

12 months ago

0.4.14-next.2

1 year ago

0.4.14-next.1

1 year ago

0.4.14

12 months ago

0.4.14-next.0

1 year ago

0.4.13

1 year ago

0.4.12

1 year ago

0.4.12-next.3

1 year ago

0.4.10

1 year ago

0.4.11

1 year ago

0.4.11-next.2

1 year ago

0.4.11-next.0

1 year ago

0.4.11-next.1

1 year ago

0.4.12-next.2

1 year ago

0.4.12-next.1

1 year ago

0.4.12-next.0

1 year ago

0.4.10-next.2

1 year ago

0.4.10-next.1

1 year ago

0.4.10-next.0

1 year ago

0.4.9

1 year ago

0.4.8

1 year ago

0.4.8-next.1

1 year ago

0.4.8-next.2

1 year ago

0.4.7-next.1

1 year ago

0.4.7-next.2

1 year ago

0.4.7-next.3

1 year ago

0.4.7-next.0

1 year ago

0.4.6-next.1

2 years ago

0.4.6-next.0

2 years ago

0.4.6-next.2

2 years ago

0.4.8-next.0

1 year ago

0.4.5

2 years ago

0.4.7

1 year ago

0.4.6

1 year ago

0.4.5-next.1

2 years ago

0.4.5-next.2

2 years ago

0.4.5-next.0

2 years ago

0.4.4-next.1

2 years ago

0.4.4-next.0

2 years ago

0.4.4

2 years ago

0.4.1-next.1

2 years ago

0.4.1-next.0

2 years ago

0.4.2-next.0

2 years ago

0.4.2-next.1

2 years ago

0.4.3-next.0

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.0-next.1

2 years ago

0.3.7-next.0

2 years ago

0.4.0

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.6-next.1

2 years ago

0.3.6-next.2

2 years ago

0.3.6-next.0

2 years ago

0.3.4-next.0

2 years ago

0.3.3

2 years ago

0.2.6-next.0

2 years ago

0.2.5-next.0

2 years ago

0.2.5-next.1

2 years ago

0.2.4-next.0

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.6

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.7

2 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago