Skip to content

Commit 117e114

Browse files
authored
Use YAML stages (#1129)
* Use YAML stages * Set DotNetValidationArtifactsCategory * Remove DotNetValidationArtifactsCategory
1 parent 2af71de commit 117e114

File tree

1 file changed

+90
-80
lines changed

1 file changed

+90
-80
lines changed

azure-pipelines.yml

+90-80
Original file line numberDiff line numberDiff line change
@@ -16,84 +16,94 @@ trigger:
1616

1717
pr: ['*']
1818

19-
jobs:
20-
- template: eng/common/templates/jobs/jobs.yml
21-
parameters:
22-
enableMicrobuild: true
23-
enablePublishBuildArtifacts: true
24-
enablePublishBuildAssets: true
25-
enablePublishTestResults: true
26-
enablePublishUsingPipelines: $(_PublishUsingPipelines)
27-
enableTelemetry: true
28-
helixRepo: aspnet/EntityFramework6
29-
jobs:
30-
- job: Windows
31-
timeoutInMinutes: 180
32-
pool:
33-
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
34-
name: NetCorePublic-Pool
35-
queue: BuildPool.Windows.10.Amd64.VS2017.Open
36-
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
37-
name: NetCoreInternal-Pool
38-
queue: BuildPool.Windows.10.Amd64.VS2017
39-
variables:
40-
- _InternalBuildArgs: ''
41-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
42-
- group: DotNet-Blob-Feed
43-
- _SignType: real
44-
- _PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json
45-
- _DotNetPublishToBlobFeed: true
46-
- _InternalBuildArgs: /p:DotNetSignType=$(_SignType)
47-
/p:TeamName=$(_TeamName)
48-
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
49-
/p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
50-
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
51-
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
52-
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
53-
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
54-
steps:
55-
- powershell: |
56-
SqlLocalDB stop MSSQLLocalDB -i
57-
SqlLocalDB start MSSQLLocalDB
58-
& "$env:ProgramFiles\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE" -S '(localdb)\MSSQLLocalDB' -b -Q @'
59-
DECLARE @name nvarchar(255);
60-
DECLARE db CURSOR FOR SELECT Name FROM sysdatabases WHERE Name NOT IN ('master', 'tempdb', 'model', 'msdb');
61-
OPEN db;
62-
FETCH NEXT FROM db INTO @name;
63-
WHILE @@FETCH_STATUS = 0
64-
BEGIN
65-
SET @name = REPLACE(@name, ']', ']]');
66-
PRINT 'Dropping database [' + @name + ']';
67-
SET @name = 'DROP DATABASE [' + @name + ']';
68-
EXEC (@name);
19+
stages:
20+
- stage: build
21+
displayName: Build
22+
jobs:
23+
- template: eng/common/templates/jobs/jobs.yml
24+
parameters:
25+
enableMicrobuild: true
26+
enablePublishBuildArtifacts: true
27+
enablePublishBuildAssets: true
28+
enablePublishTestResults: true
29+
enablePublishUsingPipelines: ${{ variables._PublishUsingPipelines }}
30+
enableTelemetry: true
31+
helixRepo: aspnet/EntityFramework6
32+
jobs:
33+
- job: Windows
34+
timeoutInMinutes: 180
35+
pool:
36+
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
37+
name: NetCorePublic-Pool
38+
queue: BuildPool.Windows.10.Amd64.VS2017.Open
39+
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
40+
name: NetCoreInternal-Pool
41+
queue: BuildPool.Windows.10.Amd64.VS2017
42+
variables:
43+
- _InternalBuildArgs: ''
44+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
45+
- group: DotNet-Blob-Feed
46+
- _SignType: real
47+
- _PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json
48+
- _DotNetPublishToBlobFeed: true
49+
- _InternalBuildArgs: /p:DotNetSignType=$(_SignType)
50+
/p:TeamName=$(_TeamName)
51+
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
52+
/p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
53+
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
54+
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
55+
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
56+
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
57+
steps:
58+
- powershell: |
59+
SqlLocalDB stop MSSQLLocalDB -i
60+
SqlLocalDB start MSSQLLocalDB
61+
& "$env:ProgramFiles\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE" -S '(localdb)\MSSQLLocalDB' -b -Q @'
62+
DECLARE @name nvarchar(255);
63+
DECLARE db CURSOR FOR SELECT Name FROM sysdatabases WHERE Name NOT IN ('master', 'tempdb', 'model', 'msdb');
64+
OPEN db;
6965
FETCH NEXT FROM db INTO @name;
70-
END;
71-
CLOSE db;
72-
DEALLOCATE db;
73-
'@
74-
displayName: Cleanup databases
75-
- task: NuGetCommand@2
76-
displayName: 'Clear NuGet caches'
77-
condition: succeeded()
78-
inputs:
79-
command: custom
80-
arguments: 'locals all -clear'
81-
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_InternalBuildArgs)
82-
name: Build
83-
- task: PublishBuildArtifacts@1
84-
displayName: Upload TestResults
85-
condition: always()
86-
continueOnError: true
87-
inputs:
88-
pathtoPublish: artifacts/TestResults/$(_BuildConfig)/
89-
artifactName: $(Agent.Os)_$(Agent.JobName) TestResults
90-
artifactType: Container
91-
parallel: true
92-
- task: PublishBuildArtifacts@1
93-
displayName: Upload artifacts
94-
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
95-
inputs:
96-
pathtoPublish: 'artifacts/packages/'
97-
artifactName: packages
98-
artifactType: Container
99-
parallel: true
66+
WHILE @@FETCH_STATUS = 0
67+
BEGIN
68+
SET @name = REPLACE(@name, ']', ']]');
69+
PRINT 'Dropping database [' + @name + ']';
70+
SET @name = 'DROP DATABASE [' + @name + ']';
71+
EXEC (@name);
72+
FETCH NEXT FROM db INTO @name;
73+
END;
74+
CLOSE db;
75+
DEALLOCATE db;
76+
'@
77+
displayName: Cleanup databases
78+
- task: NuGetCommand@2
79+
displayName: 'Clear NuGet caches'
80+
condition: succeeded()
81+
inputs:
82+
command: custom
83+
arguments: 'locals all -clear'
84+
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_InternalBuildArgs)
85+
name: Build
86+
- task: PublishBuildArtifacts@1
87+
displayName: Upload TestResults
88+
condition: always()
89+
continueOnError: true
90+
inputs:
91+
pathtoPublish: artifacts/TestResults/$(_BuildConfig)/
92+
artifactName: $(Agent.Os)_$(Agent.JobName) TestResults
93+
artifactType: Container
94+
parallel: true
95+
- task: PublishBuildArtifacts@1
96+
displayName: Upload artifacts
97+
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
98+
inputs:
99+
pathtoPublish: 'artifacts/packages/'
100+
artifactName: packages
101+
artifactType: Container
102+
parallel: true
103+
104+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
105+
- template: eng\common\templates\post-build\post-build.yml
106+
parameters:
107+
# Symbol validation isn't being very reliable lately. This should be enabled back
108+
# once this issue is resolved: https://github.com/dotnet/arcade/issues/2871
109+
enableSymbolValidation: false

0 commit comments

Comments
 (0)