-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
91 lines (74 loc) · 2.73 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
80
81
82
83
84
85
86
87
88
89
90
91
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
jobs:
- job: Nuget
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: GitVersion@4
inputs:
updateAssemblyInfo: true
- script: dotnet build --configuration $(buildConfiguration) -p:PackageVersion=$(GitVersion.FullSemVer) src/SmartHomeDotNet.sln
displayName: 'dotnet build $(buildConfiguration)'
- task: CopyFiles@2
inputs:
SourceFolder: 'src/SmartHomeDotNet.Package/bin/$(buildConfiguration)'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/Nuget/Package'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Nuget'
ArtifactName: 'Nuget'
publishLocation: 'Container'
- job: Docker_Windows
pool:
vmImage: 'windows-latest'
steps:
- task: GitVersion@4
inputs:
updateAssemblyInfo: true
- task: DockerInstaller@0
inputs:
dockerVersion: '17.09.0-ce'
- task: CmdLine@2
inputs:
script: |
echo ##vso[task.setvariable variable=GitVersion.SemVer]$(GitVersion.SemVer)>> "$(Build.ArtifactStagingDirectory)\config.txt"
docker build src/. -t smarthomedotnet:$(Build.BuildId)
docker save smarthomedotnet:$(Build.BuildId) -o "$(Build.ArtifactStagingDirectory)\smarthomedotnet-$(Build.BuildId)-win.tar"
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Docker-Windows'
publishLocation: 'Container'
- job: Docker_Linux
pool:
vmImage: 'ubuntu-latest'
steps:
# As of 2019/07/18 GitVersion is failing on Linux, even with v5.0.0.-beta5-9
# - task: GitVersion@4
# inputs:
# updateAssemblyInfo: true
- task: DockerInstaller@0
inputs:
dockerVersion: '17.09.0-ce'
- task: CmdLine@2
inputs:
# echo ##vso[task.setvariable variable=GitVersion.SemVer]$(GitVersion.SemVer)>> "$(Build.ArtifactStagingDirectory)/config.txt"
script: |
docker build src/. -t smarthomedotnet:$(Build.BuildId)
docker save smarthomedotnet:$(Build.BuildId) -o "$(Build.ArtifactStagingDirectory)/smarthomedotnet-$(Build.BuildId)-linux.tar"
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Docker-Linux'
publishLocation: 'Container'