@digital-ai/plugin-scaffolder-backend-module-digitalai-xlcli v0.0.1-alpha.0
@digital-ai/plugin-scaffolder-backend-module-digitalai-xlcli
๐ Digital.ai XL CLI Apply Actions
This Backstage software template actions enables applying configuration files to
Digital.ai XL Deploy or XL Release using the xl apply
command via the XL CLI.
๐งฉ What It Does
Based on user input, the template:
- Determines whether to use XL Deploy or XL Release
- Applies the specified configuration YAML file using the
xl
CLI - Uses credentials and host information from backstage app-config.yaml
- Outputs the target environment URL after command success.
โ๏ธ How It Works
This template uses a custom Backstage scaffolder action called xlcli:apply
. The action:
- Locates the
xl
CLI binary - Reads configuration values (host, username, password) using
readValues
- Constructs the
xl apply
command dynamically - Executes it and reports the result via Backstage scaffolder outputs
๐ Input Parameters
Name | Description | Required |
---|---|---|
product | Target product: xl-deploy or xl-release | โ Yes |
filePath | Path to the configuration YAML file to be applied | โ Yes |
Installation
From your Backstage instance root folder:
yarn add --cwd packages/backend @digital-ai/plugin-scaffolder-backend-module-digitalai-xlcli
This will download the right xl
cli binary for the current operating system and architecture from the dist at https://dist.xebialabs.com/public/xl-cli/
This behavior can be customized by adding a new "xlcli"
field in your packages/backend/package.json
file, like so:
//packages/backend/package.json
{
"xlcli": {
"version": "24.3.4",
"skipDownload": false
}
}
The custom actions used in this template require the xl CLI binary to function correctly.
If you choose to skip automatic downloading (using the xl.skipDownload option), make sure to satisfy one of the following conditions:
a. The path to the xl binary is explicitly configured in your app-config.yaml. (See configuration details below)
xlcli:
# When adding this plugin to your Backstage instance, it will automatically try to download the latest xl-cli binary and use it.
# But if you already have xl cli installed, you can override the path below.
binaryPath: '/home/ishwarya/backstage/xl_test'
b. The xl CLI is already installed and available in the systemโs global PATH on the machine running Backstage.
Configuration
- Import the actions into your
packages/backend/src/index.ts
Backend Plugin of your Backstage instance:
// packages/backend/src/index.ts
import scaffolderxlcliModule from "@digital-ai/plugin-scaffolder-backend-module-digitalai-xlcli";
const backend = createBackend();
// ....
backend.add(scaffolderxlcliModule);
Preview
Usage
Please refer the template xl-cli-github and xl-cli-yaml-inline for more details on how to use the xlcli apply action in the backstage template.
- id: xlcliApply
name: Apply xl-cli
action: digitalai:xlcli:apply
input:
product: ${{ parameters.product }}
releaseInstance: ${{ parameters.releaseInstance }}
filePath: ${{ parameters.filePath }}
6 months ago