forked from sonatype-nexus-community/DevAudit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-release-pipeline.yml
98 lines (81 loc) · 3.23 KB
/
azure-release-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
# .NET Desktop
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
name: Rel.$(Date:yyyyMMdd).$(Rev:.r)
variables:
releaseVersion: '3.3.0.0'
solution: 'DevAudit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'RuntimeDebug'
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: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
includeRootFolder: false
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).zip'
verbose: true
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).zip'
publishLocation: Container
artifactName: 'DevAudit-$(releaseVersion)-Windows'
- script: '$(Build.SourcesDirectory)/.nuget/nuget 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/nuget 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'
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: $(Build.SourcesDirectory)/build.sh /p:VersionAssembly=$(releaseVersion)
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/DevAudit.CommandLine/bin/Debug/'
includeRootFolder: false
archiveType: tar
tarCompression: gz
archiveFile: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).tar.gz'
verbose: true
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/DevAudit_$(releaseVersion).tar.gz'
publishLocation: Container
artifactName: 'DevAudit-$(releaseVersion)-Linux'
- script: docker build -t $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG .
- script: docker login -u $DOCKERUSERID -p $DOCKERUSERPASS
- script: docker push $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG