Update azure-pipelines.yml for Azure Pipelines

This commit is contained in:
Jared Jacobson 2021-09-13 10:58:20 +10:00
parent a5e887320b
commit 277af95b36

View file

@ -9,35 +9,16 @@ trigger:
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.11' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
steps: steps:
- script: | - task: GoTool@0
mkdir -p '$(GOBIN)' inputs:
mkdir -p '$(GOPATH)/pkg' version: '1.13.5'
mkdir -p '$(modulePath)' - task: Go@0
shopt -s extglob inputs:
shopt -s dotglob command: 'get'
mv !(gopath) '$(modulePath)' arguments: '-d'
echo '##vso[task.prependpath]$(GOBIN)' workingDirectory: '$(System.DefaultWorkingDirectory)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- script: |
go version
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go build -v .
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies, then build'
- task: CmdLine@2 - task: CmdLine@2
name: Build name: Build
inputs: inputs: