-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-pipeline.yml
93 lines (90 loc) · 3.93 KB
/
test-pipeline.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: $(Build.DefinitionName)_$(Build.BuildId)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
branches:
include:
- master
pool: ubuntu-18
stages:
- stage: test
displayName: 'Test Pipeline'
jobs:
- job: build
displayName: 'Pre-Requisites'
steps:
- task: GoTool@0
displayName: 'Installing Go'
inputs:
version: '1.15.6'
- task: Go@0
displayName: 'Getting Go packages'
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(Build.SourcesDirectory)'
- task: Go@0
displayName: 'Set Linux Go Environment Vars'
inputs:
command: 'custom'
customCommand: 'env'
arguments: '-w GOOS=linux GOARCH=amd64'
workingDirectory: '$(Build.SourcesDirectory)'
- task: Go@0
displayName: 'Build Linux'
inputs:
command: 'build'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CopyFiles@2
displayName: Copy Linux Build
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'DeploymentTools'
TargetFolder: '$(Build.ArtifactStagingDirectory)/DeploymentTools/linux/amd64'
- task: PublishBuildArtifacts@1
displayName: Create Linux Artifact
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/DeploymentTools/linux/amd64'
artifactName: drop_linux
- task: Go@0
displayName: 'Set Windows Go Environment Vars'
inputs:
command: 'custom'
customCommand: 'env'
arguments: '-w GOOS=windows GOARCH=amd64'
workingDirectory: '$(Build.SourcesDirectory)'
- task: Go@0
displayName: 'Build Windows'
inputs:
command: 'build'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CopyFiles@2
displayName: Copy Windows Build
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'DeploymentTools.exe'
TargetFolder: '$(Build.ArtifactStagingDirectory)/DeploymentTools/windows/amd64'
- task: PublishBuildArtifacts@1
displayName: Create Windows Artifact
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/DeploymentTools/windows/amd64'
artifactName: drop_windows
- job:
displayName: 'Run Linux'
dependsOn: build
steps:
- task: DownloadBuildArtifacts@0
displayName: Downloading Linux Artifact
inputs:
artifactName: drop_linux
downloadPath: $(Build.SourcesDirectory)/bin
- bash: |
ls -la $(Build.SourcesDirectory)/bin/drop_linux
chmod 777 $(Build.SourcesDirectory)/bin/drop_linux/DeploymentTools
cd $(Build.SourcesDirectory)/bin/drop_linux
./DeploymentTools
displayName: SetPermissions
workingDirectory: $(Build.SourcesDirectory)
env:
debug: true
ARM_CLIENT_ID: 6e4bc37d-77e3-4795-8fd7-997056845376
ARM_CLIENT_SECRET: NIMDqtHx_ZlgXj4xyiwsFGssO~T0uXMDmI
ARM_TENANT_ID: e5208e76-dd12-47f0-9541-c9b45afaffe6