Skip to content

Commit e359c49

Browse files
authored
Merge pull request #707 from dotnet-maestro-bot/merge/release/2.1-to-release/2.2
[automated] Merge branch 'release/2.1' => 'release/2.2'
2 parents 316186a + 7740559 commit e359c49

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

netci.groovy

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ def addArchival(def job) {
2727
Utilities.addArchival(job, archivalSettings)
2828
}
2929

30+
def setMachineAffinity(job, os) {
31+
// Map os to queue: If the os is present,
32+
// use the specified queue, otherwise,
33+
// fall back to the old behavior.
34+
def queueMap = [
35+
'Fedora28': 'Fedora.28.Amd64.Open'
36+
]
37+
38+
def queueName = queueMap.get(os)
39+
40+
if (queueName != null) {
41+
Utilities.setMachineAffinity(job, queueName)
42+
}
43+
else {
44+
Utilities.setMachineAffinity(job, os, "latest-or-auto")
45+
}
46+
}
47+
3048
def getDockerImageForOs(os) {
3149
def imageMap = [
3250
'RHEL7.2': 'microsoft/dotnet-buildtools-prereqs:rhel7_prereqs_2',
@@ -55,7 +73,7 @@ def addBuildStepsAndSetMachineAffinity(def job, String os, String configuration)
5573
};
5674
};
5775

58-
Utilities.setMachineAffinity(job, os, "latest-or-auto");
76+
setMachineAffinity(job, os);
5977
}
6078

6179
def addPullRequestJob(String project, String branch, String os, String configuration, boolean runByDefault)
@@ -99,6 +117,53 @@ def addPushJob(String project, String branch, String os, String configuration)
99117
};
100118
};
101119

120+
// Tarball builds that are not enforced to be offline
121+
[true, false].each { isPR ->
122+
["RHEL7.2", "CentOS7.1"].each { os ->
123+
["Release", "Debug"].each { configuration ->
124+
125+
def shortJobName = "${os}_Tarball_${configuration}";
126+
def contextString = "${os} Tarball ${configuration}";
127+
def triggerPhrase = "(?i).*test\\W+${contextString}.*";
128+
129+
def newJob = job(Utilities.getFullJobName(project, shortJobName, isPR)){
130+
steps{
131+
shell("cd ./source-build;git submodule update --init --recursive");
132+
shell("cd ./source-build;./build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${configuration} ${loggingOptions}");
133+
shell("cd ./source-build;./build-source-tarball.sh ../tarball-output --skip-build");
134+
135+
shell("cd ./tarball-output;./build.sh /p:Configuration=${configuration} ${loggingOptions}")
136+
shell("cd ./tarball-output;./smoke-test.sh --minimal --configuration ${configuration}")
137+
}
138+
}
139+
140+
setMachineAffinity(newJob, os);
141+
142+
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}");
143+
144+
// Increase timeout. The tarball builds can take longer than the 2 hour default.
145+
Utilities.setJobTimeout(newJob, 240);
146+
147+
// Clone into the source-build directory
148+
Utilities.addScmInSubDirectory(newJob, project, isPR, 'source-build');
149+
150+
addArchival(newJob);
151+
if(isPR){
152+
if(configuration == "Release"){
153+
Utilities.addGithubPRTriggerForBranch(newJob, branch, contextString);
154+
}
155+
else{
156+
Utilities.addGithubPRTriggerForBranch(newJob, branch, contextString, triggerPhrase);
157+
}
158+
}
159+
else{
160+
Utilities.addGithubPushTrigger(newJob);
161+
}
162+
163+
}
164+
}
165+
}
166+
102167
// Tarball builds that are enforced offline with unshare
103168
[true, false].each { isPR ->
104169
["RHEL7.2", "CentOS7.1"].each { os->
@@ -126,7 +191,7 @@ def addPushJob(String project, String branch, String os, String configuration)
126191
}
127192

128193
// Only Ubuntu Jenkins machines have Docker
129-
Utilities.setMachineAffinity(newJob, "Ubuntu16.04", 'latest-or-auto');
194+
setMachineAffinity(newJob, "Ubuntu16.04");
130195

131196
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}");
132197

0 commit comments

Comments
 (0)