YAML Definition
2022世界杯阿根廷预选赛赛程are defined in a pipeline config under the2022世界杯阿根廷预选赛赛程tag, as shown below. Not all sections are required by all resources.
resources: - name:type: configuration:
| Tag | Required | Description of usage |
|---|---|---|
| name |
REQUIRED |
Analphanumeric string (underscores are permitted) that makes it easy to infer what the resource represents, e.g., |
| type |
REQUIRED |
Name of the resource type that this resource is an instance of.Alist of all types is below. |
| configuration |
REQUIRED |
Specifies configuration settings, which vary for each Commonly included in this block is a setting that assigns by its name anintegrationthrough which the resource will be accessed. The integration must be compatible with the |
Using Resources
Resources can be inputs and outputs of steps in a pipeline. They can be used by steps in these ways:
Inputs
When specified in a step in theinputResources section, theresource is an input for a step. The resourcecan also be referred to by its name as an argument in shell commands that the step executes.
A resource version will automatically initiate the execution of that step that has that resource as input resource.
For example, when a Step specifies aGitReporesource, any new code commit to that Git repository will automatically cause that step to execute.
If a step that specifies animageresource andtriggeris set tofalse, the step is executed, it will use the latest version of the resource during the execution.
Outputs
When specified as the output of a step in anoutputResourcestag, the resource receives the output of the native step.The resourcecan also be referred to by its name as an argument in shell commands that the step executes.
Environment Variables
A step that specifies a resource ininputresourcescan access the resource and its attributes through environment variables. The form of the environment variable is:
res_ <资源e name>_
You can also access an integration that is specified in the resource through an environment variable, whose form is:
res_ <资源e_name>_
For example, if the definition of aGitReporesource namedapp_gitrepois:
resources: - name: app_gitRepo type: GitRepo configuration: path: user1/repo1 gitProvider: myGitProvider
Then the following environment variables will be available to a step that uses theapp_gitRepoas an input:
| Environment Variable | Result | Description |
|---|---|---|
res_app_gitRepo_path |
user1/repo1 | Returns thepathattribute of theapp_gitReporesource |
res_app_gitRepo_gitProvider_url |
Returnsurlof the Git Provider of theapp_gitReporesource |
The example step shows how these environment variables might be used to send notifications:
steps: - name: build_app type: MvnBuild configuration: sourceLocation: . mvnCommand: clean install configFileLocation: . inputResources: - name: app_gitRepo # Use the app_gitRepo resource execution: onSuccess: - send_notification notifySlack --text "Maven build completed for $res_app_gitRepo_path at $res_app_gitRepo_gitProvider_url" onFailure: - send_notification notifySlack --text "Maven build FAILED for $res_app_gitRepo_path at $res_app_gitRepo_gitProvider_url"
Arrays
For arrays within resources (e.g.VmCluster):
res_ <资源e name>_res_ <资源e name>_res_ <资源名称> _ <标题>数组_1res_ <资源e name>_
For object arrays within resources (e.g. DistributionRule):
res_ <资源e name>_res_ <资源e name>_res_ <资源名称> _ <标题>数组_1_
Resource types
这些类型的资源JFrog Pipeli2022世界杯阿根廷预选赛赛程nes supports:
