forked from hwsc-org/hwsc-dev-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
45 lines (37 loc) · 1.09 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
trigger:
- master
pr: none
pool:
vmImage: 'Ubuntu 16.04'
variables:
- name: GOBIN
value: ‘$(GOPATH)/bin’ # Go binaries path
- name: GOROOT
value: ‘/usr/local/go1.11’ # Go installation path
- name: GOPATH
value: ‘$(system.defaultWorkingDirectory)/gopath’ # Go workspace path
- name: modulePath
value: ‘$(GOPATH)/$(build.repository.name)’
- group: hwsc-dev-container-vars
steps:
- script: printenv
- 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 get -v -t -d ./...
workingDirectory: '$(modulePath)'
displayName: 'Go Get Dependencies'
- script: go build -v .
workingDirectory: '$(modulePath)'
displayName: 'Build Go Executable Test'