Files
Extension resource definitions must be stored in a subdirectory path of the form:resources/
resourceTypeName
is the named类型
of resource. Must be alphabetic characters only, and is case-sensitive. Reserved resource type names are disallowed.semver
is the semantic version number of the resource version of the formMajor.MinororMajor.Minor.Patch
The subdirectory can hold the following files to define the resource.
File | Description | Required/Optional |
---|---|---|
resourceModel.yml | Syntax modelfor the resource | Required |
onInput.sh | Shell scriptto execute when named in a step'sinputResources |
Optional |
onOutput.sh | Shell scriptto execute when named in a step'soutputResources |
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, seeManaging Pipelines Extensions.
Syntax Model
description:# User can provide an optional description configuration: # array of properties : type: # required immutable: yes|no # optional: field value cannot/can be changed validate: # optional # more property definitions userDefinedDataType: # array of data type definitions - type: # Defines a new data type configuration: - : # Specifies a property of the data type type: # required validate: # optional # more data type property definitions
description
Optional
Value:字符串
A user-friendly description of the resource's function that will be available for display in the Pipelines UI.
configuration
一块prope开始rty 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 |
---|---|---|
类型 |
Specifies an inbuilt or user-defined data type | Required |
|
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. (In other userDefinedDataType defs?)
Tag | Description of Usage | Required/Optional |
---|---|---|
类型 |
字符串that identifies this user-defined type. Must conform to alpha validation (letters only). | Required |
configuration |
一块prope开始rty 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 |
---|---|---|
类型 |
字符串that identifies the data type property | Required |
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 fileonInput.sh
shell script will be executed whenever the resource is named among the step'sinputResources.
For example:
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 fileonOutput.sh
shell script will be executed whenever the resource is named among the step'soutputResources.
For example:
test_output() { echo "onOutput Executed" echo "resource name: $1" } execute_command "test_input %%context.resourceName%%"