Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >





You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Overview

The GoBuild native step performs a build from Go (GoLang) source.


Usage

GoBuild 
apiVersion: v1.1
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
          noRegistry:       <boolean> # optional
          publishDeps:      <boolean> # 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"
Page Contents

Tags

name 

An alphanumeric string (underscores are permitted) that identifies the step.

type 

Must be GoBuild for this step type.

configuration

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
integrations Specifies an Artifactory Integration where modules will be published. If a FileSpec resource is specified in inputResources then this is optional. Otherwise, it is required.May be required
inputResources 

Must specify a GitRepo resource that has Go source files in sourceLocation.

Also may specify an optional FileSpec resource that specifies what files to copy to sourceLocation to build.

Required

Optional


In addition, these tags can be defined to support the step's native operation:

Tag

Description of usage

Required/Optional
sourceLocationLocation 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
outputLocationLocation where the built Go modules should be published. Optional
outputFileFile that has the output of the Go command. The default filename is the name of the step.Optional
resolverRepoName of the Artifactory repository to be used to resolve dependencies.Optional
repositoryAlternative to resolverRepo. Only one of these options may be specified.Optional
goCommand

Specifies a command line string of options to use with the Go client.

Default: build -o $outputLocation/$outputFile

Optional


execution

Declares collections of shell command sequences to perform for pre- and post-execution phases:

TagDescription of usageRequired/Optional
onStartCommands to execute in advance of the native operationOptional
onSuccessCommands to execute on successful completionOptional
onFailureCommands to execute on failed completionOptional
onCompleteCommands to execute on any completionOptional


The actions performed for the onExecute phase are inherent to this step type and may not be overridden.

  • No labels
Copyright © 2022 JFrog Ltd.