@@ -27,6 +27,24 @@ def addArchival(def job) {
27
27
Utilities . addArchival(job, archivalSettings)
28
28
}
29
29
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
+
30
48
def getDockerImageForOs (os ) {
31
49
def imageMap = [
32
50
' RHEL7.2' : ' microsoft/dotnet-buildtools-prereqs:rhel7_prereqs_2' ,
@@ -55,7 +73,7 @@ def addBuildStepsAndSetMachineAffinity(def job, String os, String configuration)
55
73
};
56
74
};
57
75
58
- Utilities . setMachineAffinity(job, os, " latest-or-auto " );
76
+ setMachineAffinity(job, os);
59
77
}
60
78
61
79
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)
99
117
};
100
118
};
101
119
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
+
102
167
// Tarball builds that are enforced offline with unshare
103
168
[true , false ]. each { isPR ->
104
169
[" RHEL7.2" , " CentOS7.1" ]. each { os ->
@@ -126,7 +191,7 @@ def addPushJob(String project, String branch, String os, String configuration)
126
191
}
127
192
128
193
// Only Ubuntu Jenkins machines have Docker
129
- Utilities . setMachineAffinity(newJob, " Ubuntu16.04" , ' latest-or-auto ' );
194
+ setMachineAffinity(newJob, " Ubuntu16.04" );
130
195
131
196
Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
132
197
0 commit comments