-
Notifications
You must be signed in to change notification settings - Fork 74
/
azure-dev-pipeline.yml
152 lines (126 loc) · 5.1 KB
/
azure-dev-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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# .NET Desktop
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
name: Devaudit.$(Date:yyyyMMdd).$(Rev:r)
trigger:
- v3.x
variables:
solution: 'DevAudit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'RuntimeDebug'
buildno: $[counter(variables['releaseVersion'], 1)]
VersionAssembly: $(releaseVersion).$(buildno)
jobs:
- job: Windows
pool:
vmImage: 'VS2017-Win2016'
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.Config'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
testAssemblyVer2: '$(Build.SourcesDirectory)/DevAudit.Tests/bin/Debug/DevAudit.Tests.dll'
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)
contents: 'devaudit.cmd'
targetFolder: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
includeRootFolder: false
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).$(buildno).zip'
verbose: true
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).$(buildno).zip'
publishLocation: Container
artifactName: 'DevAudit-$(releaseVersion)-Windows'
- task: Bash@3
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)/s3-upload-aws4.sh'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
arguments: 'DevAudit_$(releaseVersion).$(buildno).zip DevAudit_Latest.zip'
- script: '$(Build.SourcesDirectory)/.nuget/nugetv431 pack -Version $(nugetVersion) -IncludeReferencedProjects'
workingDirectory: '$(Build.SourcesDirectory)/DevAudit.AuditLibrary'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/DevAudit.AuditLibrary/'
contents: 'DevAudit.AuditLibrary.$(nugetVersion).nupkg'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit.AuditLibrary.$(nugetVersion).nupkg'
publishLocation: Container
artifactName: 'DevAudit.AuditLibrary.$(releaseVersion)-NuGet'
- script: '$(Build.SourcesDirectory)/.nuget/nugetv431 pack -Version $(nugetVersion) -IncludeReferencedProjects'
workingDirectory: '$(Build.SourcesDirectory)/DevAudit.CommandLine'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/DevAudit.CommandLine/'
contents: 'DevAudit.CLI.$(nugetVersion).nupkg'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit.CLI.$(nugetVersion).nupkg'
publishLocation: Container
artifactName: 'DevAudit.CLI.$(releaseVersion)-NuGet'
- script: 'choco pack --Version=$(nugetVersion)'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: 'devaudit.$(nugetVersion).nupkg'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/devaudit.$(nugetVersion).nupkg'
publishLocation: Container
artifactName: 'devaudit.$(releaseVersion)-Chocolatey'
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: $(Build.SourcesDirectory)/build.sh
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/BuildCommon
contents: 'devaudit-run-linux.sh'
targetFolder: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
- task: CmdLine@2
inputs:
script: 'mv devaudit-run-linux.sh devaudit'
workingDirectory: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
#failOnStderr: false # Optional
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
includeRootFolder: false
archiveType: tar
tarCompression: gz
archiveFile: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).$(buildno).tar.gz'
verbose: true
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).$(buildno).tar.gz'
publishLocation: Container
artifactName: 'DevAudit-$(releaseVersion).$(buildno)-Linux'
- task: Bash@3
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)/s3-upload-aws4.sh'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
arguments: 'DevAudit_$(releaseVersion).$(buildno).tar.gz DevAudit_Latest.tar.gz'
- script: docker build -t $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG .
- script: docker login -u $DOCKERUSERID -p $DOCKERUSERPASS
- script: docker push $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG