Files
Extension resource definitions must be stored in a subdirectory path of the form: resources/<namespace>/<resourceTypeName>.
namespace
is the namespace for the set of extension sets. This parent subdirectory may contain multiple step definition subdirectories.resourceTypeName
is the namedtype
of resource. Must be alphabetic characters only, and is case-sensitive. The subdirectory can hold the following files to define the resource.
File | Description | Required/Optional |
---|---|---|
resourceModel.yml | Syntax model for the resource. | Required |
and/or
| Shell script to execute when named in a step's inputResources . | Optional |
and/or
| Shell script to execute when named in a step's outputResources . | Optional |
ReadMe.md | Documentation for the custom resource. | Optional |
icon.svg | Icon graphic to represent the resource type in the interactive diagram. If not provided, Pipelines will use the default icon for the resource. | Optional |
Extension resrouce definitions are loaded from the source repository when it is configured in the Pipelines UI as an extension source.
For information on administering extension sources and extension version lifecycle staging, see Managing Pipelines Extensions.
Syntax Model
This is the syntax model for the resource.
description: <string> # User can provide an optional description platforms: # optional - os: Linux - os: Windows configuration: # array of properties <property name string>: type: <data type> # required required: <boolean> # optional immutable: <boolean> # optional: field value cannot/can be changed validate: # optional <validation specifiction> allowedIntegrationTypes: <string> # optional # more property definitions userDefinedDataType: # array of data type definitions - type: <string> # Defines a new data type configuration: - <string>: # Specifies a property of the data type type: <data type> # required required: <boolean> # optional validate: # optional <validation specifiction> allowedIntegrationTypes: <string> # optional # more data type property definitions
Tags
You can define the following tags in the resourceModel.yml
file.
description
A user-friendly description of the resource's function that will be available for display in the Pipelines UI. This is optional.
platforms
Defines the operating system for the node. Linux and Windows operating systems are supported.
This tag is optional and Linux is the default operating system when this tag is not specified.
Tag | Description of usage | Required/Optional |
---|---|---|
os | Specifies the operating system. Linux and Windows are supported. | Optional |
configuration
Begins a block of property definitions. Each property definition begins with the name of the property (letters only, case-sensitive), followed by these subordinate tags:
Tag | Description of usage | Required/Optional |
---|---|---|
type | Specifies an inbuilt or user-defined data type. | Required |
required | When set as Default is | Optional |
| When set to true , the field cannot be changed from its initial value. | Optional |
validate | Begins a validation specification block. | Optional |
userDefinedDataType
Begins a set of data type definitions. User-defined data types specify property types with validation rules, and can be used as type values.
Tag | Description of Usage | Required/Optional |
---|---|---|
type | String that identifies this user-defined type. Must conform to alpha validation (letters only). | Required |
configuration | Begins a block of property definitions. | Required |
Each property definition begins with the name of the property (letters only, case-sensitive), followed by these subordinate tags:
Tag | Description of Usage | Required/Optional |
---|---|---|
type | String that identifies an inbuilt or user-defined data type property. | Required |
required | When set as Default is | Optional |
validate | Begins a validation specification block. | Optional |
Shell Scripts
An extension resource definition may include optional shell scripts to be executed when the resource is used in a step as an input or output. These may be useful for:
- Additional validation of properties
- Testing for a property value to trigger a conditional action
onInput.sh
When present in the resource definition's repository directory, the onInput.sh
shell script will be executed whenever the resource is named among the step's
inputResources.
test_input() { echo "onInput Executed" echo "resource name: $1" } execute_command "test_input %%context.resourceName%%"
onOutput.sh
When present in the resource definition's repository directory, the onOutput.sh
shell script will be executed whenever the resource is named among the step's
OutputResources.
test_output() { echo "onOutput Executed" echo "resource name: $1" } execute_command "test_output %%context.resourceName%%"