The YAML schema for PublishBuildInfo native step is as follows:
pipelines: - name: <string> steps: - name: <string> type: PublishBuildInfo configuration: #inherits all the tags from bash; https://www.jfrog.com/confluence/display/JFROG/Bash envInclude: <string> envExclude: <string> forceXrayScan: <boolean> # default false failOnScan: <boolean> # default true inputSteps: - name: <any of the build steps or Bash step> # required outputResources: - name: <BuildInfo resource> # required execution: onStart: - echo "Preparing for work..." onSuccess: - echo "Job well done!" onFailure: - echo "uh oh, something went wrong" onComplete: #always - echo "Cleaning up some stuff" |
An alphanumeric string (underscores are permitted) that identifies the step.
Must be PublishBuildInfo
for this step type.
Specifies all configuration selections for the step's execution environment. This step inherits the Bash/PowerShell step configuration tags, including these pertinent tags:
Tag | Description of usage | Required/Optional | |
---|---|---|---|
inputSteps | Must specify a named step of one of the following types: The step must not have set | Required | |
outputResources | Must specify a BuildInfo resource to publish. The
| Required |
In addition, these tags can be defined to support the step's native operation:
All native steps derive from the Bash step. This means that all steps share the same base set of tags from Bash, while native steps have their own additional tags as well that support the step's particular function. So it's important to be familiar with the Bash step definition, since it's the core of the definition of all other steps. |
Tag | Description of usage | Required/Optional |
---|---|---|
envInclude | Pattern for which environment variables to include. Default is to include all the environment variables. | Optional |
envExclude | Pattern for which environment variables to exclude. This is applied in addition to the base exclude pattern applied to all build info. | Optional |
forceXrayScan | When set to true, forces an Xray scan after publishing to Artifactory. Default is false. | Optional |
failOnScan | When set to true, and when the Xray Policy Rule Fail Build checkbox is checked, a failed Xray scan will result in a failure of the step. Default is true. | Optional |
Declares collections of shell command sequences to perform for pre- and post-execution phases:
Tag | Description of usage | Required/Optional |
---|---|---|
onStart | Commands to execute in advance of the native operation | Optional |
onSuccess | Commands to execute on successful completion | Optional |
onFailure | Commands to execute on failed completion | Optional |
onComplete | Commands to execute on any completion | Optional |
The actions performed for the onExecute
phase are inherent to this step type and may not be overridden.
The following examples show how to configure a PublishBuildInfo step.
Pushes the image created by the DockerBuild input step and published BuildInfo to Artifactory.
# This config file is templatized so that it can be easily customized. Values can be provided with a values.yml file. template: true # required for local templates valuesFilePath: ./values.yml resources: - name: app_repo1 type: GitRepo configuration: gitProvider: {{ .Values.gitIntegration }} path: {{ .Values.gitRepositoryPath }} branches: include: master - name: app_buildinfo1 type: BuildInfo configuration: sourceArtifactory: {{ .Values.artifactoryIntegration }} - name: app_promoted_buildinfo1 type: BuildInfo configuration: sourceArtifactory: {{ .Values.artifactoryIntegration }} pipelines: - name: app_dev_pipeline steps: - name: app_build type: DockerBuild configuration: affinityGroup: docker_group dockerFileLocation: . dockerFileName: Dockerfile dockerImageName: {{ .Values.artifactoryUrl }}/{{ .Values.sourceRepository }}/{{ .Values.imageName }} dockerImageTag: ${run_number} inputResources: - name: app_repo integrations: - name: {{ .Values.artifactoryIntegration }} - name: app_push type: DockerPush configuration: affinityGroup: docker_group targetRepository: {{ .Values.sourceRepository }} integrations: - name: {{ .Values.artifactoryIntegration }} inputSteps: - name: app_build - name: publish_app_build type: PublishBuildInfo configuration: affinityGroup: docker_group inputSteps: - name: app_push outputResources: - name: app_buildinfo |
This extends the first MvnBuild example to publish the build info using a PublishBuildInfo step.
pipelines: - name: MyMavenPipeline steps: - name: MavenWithArtifactory type: MvnBuild configuration: integrations: - name: art inputResources: - name: mvn_repo - name: publishBuildInfoStep type: PublishBuildInfo configuration: inputSteps: - name: MavenWithArtifactory outputResources: - name: buildInfoResource |
An NpmBuild and NpmPublish example publishing the build info using a PublishBuildInfo step and triggering an Xray scan in the PublishBuildInfo step.
pipelines: - name: npmBuildPipeline steps: - name: npmBuildStep type: NpmBuild configuration: inputResources: - name: gitRepoResource integrations: - name: artifactory_integration - name: npmPublishStep type: NpmPublish configuration: deployerRepo: npm-repo inputSteps: - name: npmBuildStep outputResources: - name: outputBuildInfo - name: publishBuildInfoStep type: PublishBuildInfo configuration: forceXrayScan: true inputSteps: - name: npmPublishStep outputResources: - name: buildInfoResource |
A Bash step input to the PublishBuildInfo step following an earlier GoPublishModule step.
pipelines: - name: goPublishModulePipeline steps: - name: goPublishModuleStep type: GoPublishModule configuration: version: "v0.0.${run_number}" targetRepository: go-repo self: true deps: ALL inputResources: - name: gitRepoResource integrations: - name: artifactory_integration - name: moduleTestStep type: Bash configuration: inputSteps: - name: goPublishModuleStep execution: onExecute: - "echo 'Running some tests.'" - name: publishBuildInfoStep type: PublishBuildInfo configuration: environmentVariables: buildStepName: goPublishModuleStep inputSteps: - name: moduleTestStep outputResources: - name: buildInfoResource |
When you use the PublishBuildInfo native step in a pipeline, it performs the following functions in the background: