The YAML schema for GoPublishBinary native step is as follows:
An alphanumeric string (underscores are permitted) that identifies the step.
GoPublishBinary for this step type.
Description of usage
| ||May be required|
Must specify a BuildInfo resource when
|May be required|
| ||Must specify a GoBuild, Bash, or PowerShell step.||Required|
In addition, these tags can be defined to support the step's native operation:
Tags derived from Bash
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.
Description of usage
When true, forces a scan of the pushed image by JFrog Xray.
Default is false.
When set to t
When set to
|Repository in Artifactory where the module will be published.||Required|
Fail the step if signatures of build artifacts cannot be verified.
|Optional (Signed Pipelines must be enabled)|
Declares collections of shell command sequences to perform for pre- and post-execution phases:
|Tag||Description of usage||Required/Optional|
|Commands to execute in advance of the native operation||Optional|
|Commands to execute on successful completion||Optional|
|Commands to execute on failed completion||Optional|
|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 GoPublishBinary step.
Upload to Artifactory
Uploads the binary built by a GoBuild step to an Artifactory repository named go-local.
- This example requires an Artifactory Integration and a GitHub Integration.
- The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.
- For more information about running this example, see Pipeline Example: Go Build.
Upload Build Info
Uploads the binary built by a GoBuild step to an Artifactory repository named go-repo and uploads build info. This extends example 1 in the GoBuild documentation.
Publish Build Info and Trigger Xray Scan
In this example, build info is published and an Xray scan triggered.
How it Works
When you use the GoPublishBinary native step in a pipeline, it performs the following functions in the background:
- jfrog rt config (if there is a BuildInfo output, configure the JFrog CLI with those credentials)
- jfrog rt use (specify the configured credentials to use)
- restore_run_files (copy the output and build info from the GoBuild step)
- jfrog rt upload (upload the binary)
- jfrog rt build-publish (if autoPublishBuildInfo is true, publish the build info)
- write_output (if autoPublishBuildInfo is true, update the output BuildInfo resource)
- jfrog rt build-scan (if forceXrayScan is true, trigger a scan)
- add_run_files (update the build info saved in run state)