forked from MicrosoftDocs/mslearn-tailspin-spacegame-web
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
98 lines (84 loc) · 2.62 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
92
93
94
95
96
97
98
trigger:
- '*'
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot'
ProjectKey: TailspinSpaceGame
ProjectName: TailspinSpaceGame
stages:
- stage : build
jobs:
- job: build
steps:
# - task: SonarCloudPrepare@1
# displayName: 'Prepare analysis on SonarCloud'
# inputs:
# SonarCloud: 'Srivatsa-SonarCloud'
# organization: 'srivatsamarichi'
# scannerMode: 'MSBuild'
# projectKey: '$(ProjectKey)'
# projectName: '$(ProjectName)'
- task: DotNetCoreCLI@2
displayName: 'Restore project dependencies'
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build the project'
inputs:
command: 'build'
arguments: '--no-restore --configuration $(buildConfiguration)'
projects: '**/*.csproj'
# - task: SonarCloudAnalyze@1
# displayName: 'Run Code Analysis'
# - task: DotNetCoreCLI@2
# displayName: 'Test the project'
# inputs:
# command: 'test'
# arguments: --configuration $(BuildConfiguration)
# testRunTitle: 'Spacegame'
- task: DotNetCoreCLI@2
displayName: 'Publish the project'
inputs:
command: 'publish'
projects: '**/*.csproj'
publishWebProjects: false
arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
condition: succeeded()
- stage : package
dependsOn: build
condition: succeeded()
jobs:
- job: package
steps:
- task: NuGetCommand@2
displayName: 'NuGet package Web'
inputs:
command: 'pack'
packagesToPack: 'Tailspin.SpaceGame.Web/Tailspin.SpaceGame.Web.csproj'
- task: NuGetCommand@2
displayName: 'NuGet package Test'
inputs:
command: 'pack'
packagesToPack: 'Tailspin.SpaceGame.Web.Tests/Tailspin.SpaceGame.Web.Tests.csproj'
- task: NuGetCommand@2
displayName: 'NuGet Push'
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'c53ed56f-c130-470b-a6ae-3c4a93266530/6d3e3062-8453-4dbe-b44c-951217317e15'
- stage : OSS
dependsOn: build
condition: succeeded()
jobs:
- job: oss
steps:
- task: WhiteSource Bolt@20
inputs:
cwd: '$(build.sourcesdirectory)'