github.com/confluentinc/cli@v1.100.0/azure-pipelines-templates/setup-go.yml (about) 1 steps: 2 - script: | 3 wget "https://golang.org/dl/go1.14.7.linux-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.14.7.tar.gz" 4 tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.14.7.tar.gz" 5 condition: eq( variables['Agent.OS'], 'Linux' ) 6 displayName: Install Go 1.14.7 (Linux) 7 8 - script: | 9 brew install gnu-tar 10 condition: eq( variables['Agent.OS'], 'Darwin' ) 11 displayName: Install gnu-tar (Darwin) 12 13 - script: | 14 echo $HOMEBREW_CASK_OPTS 15 brew update 16 brew cask install google-chrome 17 condition: eq( variables['Agent.OS'], 'Darwin' ) 18 displayName: Install chrome (Darwin) 19 20 - script: | 21 wget "https://golang.org/dl/go1.14.7.darwin-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.14.7.tar.gz" 22 gtar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.14.7.tar.gz" 23 condition: eq( variables['Agent.OS'], 'Darwin' ) 24 displayName: Install Go 1.14.7 (Darwin) 25 26 - powershell: | 27 $ProgressPreference = 'SilentlyContinue' 28 Invoke-WebRequest -Uri "https://golang.org/dl/go1.14.7.windows-amd64.zip" -OutFile "$(Agent.BuildDirectory)\go1.14.7.zip" -Verbose 29 & ${env:ProgramFiles}\7-Zip\7z.exe x $(Agent.BuildDirectory)/go1.14.7.zip "-o$(Agent.BuildDirectory)" -y 30 condition: eq( variables['Agent.OS'], 'Windows_NT' ) 31 displayName: Install Go 1.14.7 (Windows) 32 33 # Linux 34 - bash: | 35 echo "##vso[task.setvariable variable=GOROOT]$(Agent.BuildDirectory)/go" 36 echo "##vso[task.setvariable variable=GOPATH]$(Agent.BuildDirectory)/gopath" 37 echo "##vso[task.setvariable variable=GOBIN]$(Agent.BuildDirectory)/go/bin" 38 echo "##vso[task.setvariable variable=modulePath]$(Agent.BuildDirectory)/go/src/github.com/$(build.repository.name)" 39 condition: ne( variables['Agent.OS'], 'Windows_NT' ) 40 displayName: Properly configure our custom Go environment (Mac/Linux) 41 42 - bash: | 43 echo "##vso[task.setvariable variable=GOROOT]$(Agent.BuildDirectory)\go" 44 echo "##vso[task.setvariable variable=GOPATH]$(Agent.BuildDirectory)\gopath" 45 echo "##vso[task.setvariable variable=GOBIN]$(Agent.BuildDirectory)\go\bin" 46 echo "##vso[task.setvariable variable=modulePath]$(Agent.BuildDirectory)\go\src\github.com\$(build.repository.name)" 47 condition: eq( variables['Agent.OS'], 'Windows_NT' ) 48 displayName: Properly configure our custom Go environment (Windows) 49 50 - script: | 51 echo '##vso[task.prependpath]$(GOROOT)/bin' 52 echo '##vso[task.prependpath]$(GOPATH)/bin' 53 mkdir -p ${GOPATH}\bin 54 mkdir -p ${GOROOT}\bin 55 condition: ne( variables['Agent.OS'], 'Windows_NT' ) 56 displayName: Set up the Go workspace (non-Windows) 57 58 - script: | 59 echo '##vso[task.prependpath]$(GOROOT)\bin' 60 echo '##vso[task.prependpath]$(GOPATH)\bin' 61 echo '##vso[task.setvariable variable=PATH;]$(GOROOT)\bin;$(GOPATH)\bin;$(PATH)' 62 echo '$(GOROOT)' 63 echo '$(GOPATH)' 64 echo '$(PATH)' 65 echo '%PATH%' 66 mkdir ${GOPATH}\bin 67 mkdir ${GOROOT}\bin 68 condition: eq( variables['Agent.OS'], 'Windows_NT' ) 69 displayName: Set up the Go workspace (Windows)