setup-go 0.1.0

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

This Pipelines Task installs and sets up Go programming language.

Prerequisites

None

Usage

Basic:

- task: jfrog/setup-go@v0.1.0
  input:
    version: "1.20.1"  

You can use an Artifactory integration or JFrog Platform Access Token integration and local generic repository to cache the Go installer. The first run of the task will download the installer from the internet and upload it to Artifactory. Following runs will download the installer from Artifactory instead.

- task: jfrog/setup-go@v0.1.0
  input:
    version: "1.20.1"
    cacheIntegration: "my_artifactory"
    cacheRepository: "pipelines_cache_local" 

Input Variables

Name

Required

Default

Description

version

true

Golang version to be installed

cacheIntegration

false

Any Artifactory integration or JFrog Platform Access Token integration available

JFrog Platform Access Token integration or Artifactory integration to be used to cache the Go installer

cacheRepository

false

Artifactory repository to be used to cache the Go installer

Output Variables

None

Exported Environment Variables

Name

Description

GOROOT

Location where the Go SDK is installed

GOPATH

The root of the Go workspace

PATH

$GOROOT/bin appended to PATH

How does it work?

To have Go installed, the task performs the following steps:

  • Downloads Go installer from https://go.dev/dl

  • Uploads installer to Artifactory if cache is enabled (Following runs will download from Artifactory)

  • Extracts the installer archive contents to the step workspace

  • Setup Go environment variables

  • Run go env command to display environment configuration

License

This project is licensed under Apache 2.0 license.