The YAML schema for GoBuild native step is as follows:
pipelines: - name: <string> steps: - name: <string> type: GoBuild configuration: #inherits from bash sourceLocation: <string> # optional outputLocation: <string> # optional outputFile: <string> # optional resolverRepo: <string> # optional repository: <string> # optional goCommand: <string> # optional integrations: - name: <artifactory integration> # may be required inputResources: - name: <GitRepo resource> # required - name: <FileSpec resource> # optional 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.
GoBuild for this step type.
Description of usage
| ||Specifies an Artifactory Integration where modules will be published. If a FileSpec resource is specified in ||May be required|
Must specify a GitRepo resource that has Go source files in
Also may specify an optional FileSpec resource that specifies what files to copy to
In addition, these tags can be defined to support the step's native operation:
Description of usage
|Location where the Go source files are available, relative to the root of the GitRepo repository. If not specified, the default is the root of the GitRepo repository.||Optional|
|Location where the built Go modules should be published.||Optional|
|File that has the output of the Go command. The default filename is the name of the step.||Optional|
|Name of the Artifactory repository to be used to resolve dependencies.||Optional|
|Alternative to ||Optional|
Specifies a command line string of options to use with the Go client.
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 GoBuild step.
A GoBuild step using default locations.
pipelines: - name: goBuildPipeline steps: - name: goBuildStep type: GoBuild configuration: inputResources: - name: gitRepoResource integrations: - name: artifactory_integration
A GoBuild step with a FileSpec input providing files for the build that are not in the GitRepo and resolverRepo specifying an Artifactory repository to use when resolving dependencies.
pipelines: - name: goBuildPipeline steps: - name: goBuildStep type: GoBuild configuration: resolverRepo: repo inputResources: - name: gitRepoResource - name: fileSpec
A GoBuild step with an alternative source location in the GitRepo and an alternative Go command for the build.
pipelines: - name: goBuildPipeline steps: - name: goBuildStep type: GoBuild configuration: sourceLocation: "app/go" goCommand: "build -insecure -o output/outputFile" inputResources: - name: gitRepoResource integrations: - name: artifactory_integration
When you use the GoBuild native step in a pipeline, it performs the following functions in the background: