-
Notifications
You must be signed in to change notification settings - Fork 163
/
azure-pipelines.yml
79 lines (69 loc) · 2.11 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
jobs:
- job: Build_Binaries
pool:
vmImage: 'Ubuntu 16.04'
variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.12' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
# TODO: modules should be the default in Go 1.13, so this won't be needed
GO111MODULE: on
steps:
- bash: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- bash: ./build.sh
workingDirectory: '$(modulePath)'
env:
ARTIFACTS: '$(Build.ArtifactStagingDirectory)'
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
artifactName: binaries
pathtoPublish: '$(Build.ArtifactStagingDirectory)/binaries'
displayName: 'Publish Artifact'
- job: Build_Images_Linux
dependsOn: Build_Binaries
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
downloadPath: artifacts
artifactName: binaries
- bash: |
./build-images-linux.sh
displayName: 'Build images'
- bash: |
./push-images-linux.sh
env:
DOCKER_PASSWORD: '$(DOCKER_PASSWORD)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Push images'
- job: Build_Images_Windows
dependsOn: Build_Binaries
pool:
vmImage: 'win1803'
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
downloadPath: artifacts
artifactName: binaries
- bash: |
./build-images-windows.sh
displayName: 'Build images'
- bash: |
./push-images-windows.sh
env:
DOCKER_PASSWORD: '$(DOCKER_PASSWORD)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Push images'