Skip to main content
Version: Early Access

Provisioning Deploy Applications in Backstage Using YAML

Overview

This guide explains how to provision using YAML configuration files and the XL CLI actions in Backstage. You can provide Inline YAML or use files stored in a GitHub repository.

Prerequisites

  • Install Custom actions. For more information, see Scaffolder Backend Module Digital.ai for more details.
  • Install RoadieHQ to use the fs:write action.
  • The app-config.yaml file is configured with environment-specific hostnames and targets.
  • xl-cli is installed and accessible in the Backstage action context.
  • A GitHub repository is available if using repository-based YAML files.

Set Up Templates in Backstage

You can set up and preview templates in Backstage using either local files or GitHub integration. Choose the option that works best for your environment.

Option 1: Use Local Files

  1. Copy the xl-cli-yaml-inline folder to the examples folder in your Backstage root directory.
  2. Add the following to your app-config.yaml file:
  - type: file
target: ../../examples/xl-cli-yaml-inline/template.yaml
rules:
- allow: [ Template ]
- type: file
target: ../../examples/xl-cli-github/template.yaml
rules:
- allow: [ Template ]
  1. Restart the Backstage.

    Once set up, you can preview the templates in the Backstage catalog.

    Preview the template in Backstage. Preview the template in Backstage.

Option 2: Use GitHub Integration

  1. Set up the GitHub integration support. For more information, see GitHub integration
  integrations:
github:
- host: github.com
This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
about setting up the GitHub integration from the Github Integration guide above
token: <token>
  1. Restart the Backstage.

  2. In your localhost, open catalog-import and import both templates using their GitHub URLs:

    Inline YAML Template

    GitHub YAML Template

    note

    These are example templates. Use them for reference only.

    After import, the templates will appear in your Backstage catalog. You can then preview them.

    Once set up, you can preview the templates in the Backstage catalog.

    Preview the template in Backstage. Preview the template in Backstage.

Action Parameters

The action reads configuration from Backstage app-config.yaml where Deploy environment-specific hostnames and runs xl-cli commands to apply the YAML.

ParameterDescription
productOperation type: xl-deploy.
yamlFilePathPath to the YAML file. This can be inline content or a GitHub file path.

Below are some examples to Provision an application in Backstage

Provision an Application Using Inline YAML

Steps:

  1. In the Backstage sidebar, go to Create and CHOOSE Provisioning Digital.ai Deploy by applying Inline YAML using the xl-cli Template.
  2. Select xl-deploy from product dropdown.
  3. Paste the YAML content in the Text field.
note

Skip Release instance option as it is not applicable for xl-deploy.

  1. Specify the Deploy application filePath where the YAML file should be stored.

  2. Click REVIEW to confirm your inputs.

    Parameter

  3. Click CREATE to start the provisioning.

This will create resources as defined in your YAML configuration.
For example, you can provision applications or deployments based on the provided YAML.

Execution

Provision an Application Using YAML from GitHub

Steps:

  1. In the Backstage sidebar, go to Create and CHOOSE Provisioning Digital.ai Deploy via YAML from GitHub using the xl-cli Template.

  2. Select xl-deploy from product dropdown.

  3. Enter your username or Github organization in GitHub organization section.

  4. Enter the repository name.

  5. Specify the path to the YAML file within the repository.

  6. Click Review to confirm your inputs.

    Parameter

  7. Click Create to start the provisioning.

  8. Monitor the execution logs from xl-cli for progress and confirmation.

  9. Verify the deployment in the xl-deploy UI.

This will create resources as defined in your YAML configuration.
For example, you can provision applications or deployments based on the provided YAML.

Execution