Skip to content

Commit e94d5b4

Browse files
committed
Building in Docker. Fixes.
1 parent 0a1d3d2 commit e94d5b4

25 files changed

+510
-164
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ eng/tools
1111
.teamcity/target
1212
/.config/dotnet-tools.json
1313
/.tools
14-
nuget.config
14+
nuget.config
15+
global.json
16+
eng/docker-context/env.g.json

.teamcity/settings.kts

Lines changed: 33 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object DebugBuild : BuildType({
3232
params {
3333
text("BuildArguments", "", label = "Build Arguments", description = "Arguments to append to the 'Build' build step.", allowEmpty = true)
3434
text("DefaultBranch", "develop/2023.2", label = "Default Branch", description = "The default branch of this build configuration.")
35-
text("TimeOut", "300", label = "Time-Out Threshold", description = "Seconds after the duration of the last successful build.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
35+
text("TimeOut", "60", label = "Time-Out", description = "Timeout, in minutes.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
3636
}
3737

3838
vcs {
@@ -41,49 +41,30 @@ object DebugBuild : BuildType({
4141

4242
steps {
4343
powerShell {
44-
name = "Kill background processes before cleanup"
45-
id = "PreKill"
44+
name = "Prepare the Docker image"
45+
id = "PrepareImage"
4646
scriptMode = file {
47-
path = "Build.ps1"
47+
path = "DockerBuild.ps1"
4848
}
4949
noProfile = false
50-
scriptArgs = "tools kill"
50+
scriptArgs = "-BuildImage -ImageName postsharpengineering-2023.2"
5151
}
5252
powerShell {
5353
name = "Build"
5454
id = "Build"
5555
scriptMode = file {
56-
path = "Build.ps1"
57-
}
58-
noProfile = false
59-
scriptArgs = "test --configuration Debug --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
60-
}
61-
powerShell {
62-
name = "Kill background processes before next build"
63-
id = "PostKill"
64-
scriptMode = file {
65-
path = "Build.ps1"
56+
path = "DockerBuild.ps1"
6657
}
6758
noProfile = false
68-
scriptArgs = "tools kill"
59+
scriptArgs = "-ImageName postsharpengineering-2023.2 -NoBuildImage test --configuration Debug --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
6960
}
7061
}
71-
7262
failureConditions {
73-
failOnMetricChange {
74-
metric = BuildFailureOnMetric.MetricType.BUILD_DURATION
75-
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
76-
comparison = BuildFailureOnMetric.MetricComparison.MORE
77-
compareTo = build {
78-
buildRule = lastSuccessful()
79-
}
80-
stopBuildOnFailure = true
81-
param("metricThreshold", "%TimeOut%")
82-
}
63+
executionTimeoutMin = 60
8364
}
8465

8566
requirements {
86-
equals("env.BuildAgentType", "caravela04cloud")
67+
equals("env.BuildAgentType", "docker-win-x64-md")
8768
}
8869

8970
features {
@@ -113,7 +94,7 @@ object ReleaseBuild : BuildType({
11394
params {
11495
text("BuildArguments", "", label = "Build Arguments", description = "Arguments to append to the 'Build' build step.", allowEmpty = true)
11596
text("DefaultBranch", "develop/2023.2", label = "Default Branch", description = "The default branch of this build configuration.")
116-
text("TimeOut", "300", label = "Time-Out Threshold", description = "Seconds after the duration of the last successful build.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
97+
text("TimeOut", "60", label = "Time-Out", description = "Timeout, in minutes.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
11798
}
11899

119100
vcs {
@@ -122,49 +103,30 @@ object ReleaseBuild : BuildType({
122103

123104
steps {
124105
powerShell {
125-
name = "Kill background processes before cleanup"
126-
id = "PreKill"
106+
name = "Prepare the Docker image"
107+
id = "PrepareImage"
127108
scriptMode = file {
128-
path = "Build.ps1"
109+
path = "DockerBuild.ps1"
129110
}
130111
noProfile = false
131-
scriptArgs = "tools kill"
112+
scriptArgs = "-BuildImage -ImageName postsharpengineering-2023.2"
132113
}
133114
powerShell {
134115
name = "Build"
135116
id = "Build"
136117
scriptMode = file {
137-
path = "Build.ps1"
138-
}
139-
noProfile = false
140-
scriptArgs = "test --configuration Release --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
141-
}
142-
powerShell {
143-
name = "Kill background processes before next build"
144-
id = "PostKill"
145-
scriptMode = file {
146-
path = "Build.ps1"
118+
path = "DockerBuild.ps1"
147119
}
148120
noProfile = false
149-
scriptArgs = "tools kill"
121+
scriptArgs = "-ImageName postsharpengineering-2023.2 -NoBuildImage test --configuration Release --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
150122
}
151123
}
152-
153124
failureConditions {
154-
failOnMetricChange {
155-
metric = BuildFailureOnMetric.MetricType.BUILD_DURATION
156-
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
157-
comparison = BuildFailureOnMetric.MetricComparison.MORE
158-
compareTo = build {
159-
buildRule = lastSuccessful()
160-
}
161-
stopBuildOnFailure = true
162-
param("metricThreshold", "%TimeOut%")
163-
}
125+
executionTimeoutMin = 60
164126
}
165127

166128
requirements {
167-
equals("env.BuildAgentType", "caravela04cloud")
129+
equals("env.BuildAgentType", "docker-win-x64-md")
168130
}
169131

170132
features {
@@ -185,7 +147,7 @@ object PublicBuild : BuildType({
185147
params {
186148
text("BuildArguments", "", label = "Build Arguments", description = "Arguments to append to the 'Build' build step.", allowEmpty = true)
187149
text("DefaultBranch", "develop/2023.2", label = "Default Branch", description = "The default branch of this build configuration.")
188-
text("TimeOut", "300", label = "Time-Out Threshold", description = "Seconds after the duration of the last successful build.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
150+
text("TimeOut", "60", label = "Time-Out", description = "Timeout, in minutes.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
189151
}
190152

191153
vcs {
@@ -194,49 +156,30 @@ object PublicBuild : BuildType({
194156

195157
steps {
196158
powerShell {
197-
name = "Kill background processes before cleanup"
198-
id = "PreKill"
159+
name = "Prepare the Docker image"
160+
id = "PrepareImage"
199161
scriptMode = file {
200-
path = "Build.ps1"
162+
path = "DockerBuild.ps1"
201163
}
202164
noProfile = false
203-
scriptArgs = "tools kill"
165+
scriptArgs = "-BuildImage -ImageName postsharpengineering-2023.2"
204166
}
205167
powerShell {
206168
name = "Build"
207169
id = "Build"
208170
scriptMode = file {
209-
path = "Build.ps1"
210-
}
211-
noProfile = false
212-
scriptArgs = "test --configuration Public --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
213-
}
214-
powerShell {
215-
name = "Kill background processes before next build"
216-
id = "PostKill"
217-
scriptMode = file {
218-
path = "Build.ps1"
171+
path = "DockerBuild.ps1"
219172
}
220173
noProfile = false
221-
scriptArgs = "tools kill"
174+
scriptArgs = "-ImageName postsharpengineering-2023.2 -NoBuildImage test --configuration Public --buildNumber %build.number% --buildType %system.teamcity.buildType.id% %BuildArguments%"
222175
}
223176
}
224-
225177
failureConditions {
226-
failOnMetricChange {
227-
metric = BuildFailureOnMetric.MetricType.BUILD_DURATION
228-
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
229-
comparison = BuildFailureOnMetric.MetricComparison.MORE
230-
compareTo = build {
231-
buildRule = lastSuccessful()
232-
}
233-
stopBuildOnFailure = true
234-
param("metricThreshold", "%TimeOut%")
235-
}
178+
executionTimeoutMin = 60
236179
}
237180

238181
requirements {
239-
equals("env.BuildAgentType", "caravela04cloud")
182+
equals("env.BuildAgentType", "docker-win-x64-md")
240183
}
241184

242185
features {
@@ -257,7 +200,7 @@ object PublicDeployment : BuildType({
257200
params {
258201
text("PublishArguments", "", label = "Publish Arguments", description = "Arguments to append to the 'Publish' build step.", allowEmpty = true)
259202
text("DefaultBranch", "develop/2023.2", label = "Default Branch", description = "The default branch of this build configuration.")
260-
text("TimeOut", "300", label = "Time-Out Threshold", description = "Seconds after the duration of the last successful build.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
203+
text("TimeOut", "30", label = "Time-Out", description = "Timeout, in minutes.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
261204
}
262205

263206
vcs {
@@ -275,22 +218,12 @@ object PublicDeployment : BuildType({
275218
scriptArgs = "publish --configuration Public %PublishArguments%"
276219
}
277220
}
278-
279221
failureConditions {
280-
failOnMetricChange {
281-
metric = BuildFailureOnMetric.MetricType.BUILD_DURATION
282-
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
283-
comparison = BuildFailureOnMetric.MetricComparison.MORE
284-
compareTo = build {
285-
buildRule = lastSuccessful()
286-
}
287-
stopBuildOnFailure = true
288-
param("metricThreshold", "%TimeOut%")
289-
}
222+
executionTimeoutMin = 30
290223
}
291224

292225
requirements {
293-
equals("env.BuildAgentType", "caravela04cloud")
226+
equals("env.BuildAgentType", "docker-win-x64-md")
294227
}
295228

296229
features {
@@ -326,7 +259,7 @@ object VersionBump : BuildType({
326259
params {
327260
text("BumpArguments", "", label = "Bump Arguments", description = "Arguments to append to the 'Bump' build step.", allowEmpty = true)
328261
text("DefaultBranch", "develop/2023.2", label = "Default Branch", description = "The default branch of this build configuration.")
329-
text("TimeOut", "300", label = "Time-Out Threshold", description = "Seconds after the duration of the last successful build.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
262+
text("TimeOut", "15", label = "Time-Out", description = "Timeout, in minutes.", regex = """\d+""", validationMessage = "The timeout has to be an integer number.")
330263
}
331264

332265
vcs {
@@ -344,22 +277,12 @@ object VersionBump : BuildType({
344277
scriptArgs = "bump %BumpArguments%"
345278
}
346279
}
347-
348280
failureConditions {
349-
failOnMetricChange {
350-
metric = BuildFailureOnMetric.MetricType.BUILD_DURATION
351-
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
352-
comparison = BuildFailureOnMetric.MetricComparison.MORE
353-
compareTo = build {
354-
buildRule = lastSuccessful()
355-
}
356-
stopBuildOnFailure = true
357-
param("metricThreshold", "%TimeOut%")
358-
}
281+
executionTimeoutMin = 15
359282
}
360283

361284
requirements {
362-
equals("env.BuildAgentType", "caravela04cloud")
285+
equals("env.BuildAgentType", "docker-win-x64-md")
363286
}
364287

365288
features {

0 commit comments

Comments
 (0)