From a5e887320b6d68816a3c2338f6afccc1d9dae6a3 Mon Sep 17 00:00:00 2001 From: Jared Jacobson <71237599+jaredjn@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:55:23 +1000 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 876ef9f29..d558b0992 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,19 +16,27 @@ variables: modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code steps: -# - task: CmdLine@2 -# displayName: 'List all directories' -# inputs: -# script: | -# echo "Structure of work folder of this pipeline:" -# tree $(Agent.WorkFolder) /f -# echo "Build.ArtifactStagingDirectory:" -# echo "$(Build.ArtifactStagingDirectory)" -# echo "Build.BinariesDirectory:" -# echo "$(Build.BinariesDirectory)" -# echo "Build.SourcesDirectory:" -# echo "$(Build.SourcesDirectory)" -# tree $(Build.SourcesDirectory) /f +- script: | + mkdir -p '$(GOBIN)' + mkdir -p '$(GOPATH)/pkg' + mkdir -p '$(modulePath)' + shopt -s extglob + shopt -s dotglob + mv !(gopath) '$(modulePath)' + echo '##vso[task.prependpath]$(GOBIN)' + 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 name: Build