@@ -55,16 +55,16 @@ def getDockerImageForOs(os) {
55
55
return imageMap. get(os)
56
56
}
57
57
58
- def addBuildStepsAndSetMachineAffinity (def job , String os , String configuration ) {
58
+ def addBuildStepsAndSetMachineAffinity (def job , String os , String configuration , boolean portable ) {
59
59
job. with {
60
60
steps {
61
61
if (os == " Windows_NT" ) {
62
62
batchFile(" git submodule update --init --recursive" );
63
- batchFile(" .\\ build.cmd /p:Configuration=${ configuration} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " )
63
+ batchFile(" .\\ build.cmd /p:Configuration=${ configuration} /p:PortableBuild= ${ portable } /p: FailOnPrebuiltBaselineError=true ${ loggingOptions} " )
64
64
}
65
65
else {
66
66
shell(" git submodule update --init --recursive" );
67
- shell(" ./build.sh /p:Configuration=${ configuration} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " );
67
+ shell(" ./build.sh /p:Configuration=${ configuration} /p:PortableBuild= ${ portable } /p: FailOnPrebuiltBaselineError=true ${ loggingOptions} " );
68
68
smokeTestExcludes = " " ;
69
69
if (os == " Fedora24" || os == " OSX10.12" ) {
70
70
// Dev certs doesn't seem to work in these platforms. https://github.com/dotnet/source-build/issues/560
@@ -78,90 +78,116 @@ def addBuildStepsAndSetMachineAffinity(def job, String os, String configuration)
78
78
setMachineAffinity(job, os);
79
79
}
80
80
81
- def addPullRequestJob (String project , String branch , String os , String configuration , boolean runByDefault )
81
+ def addPullRequestJob (String project , String branch , String os , String configuration , boolean portable , boolean runByDefault )
82
82
{
83
- def newJobName = Utilities . getFullJobName(project, " ${ os} _${ configuration} " , true );
83
+ def config = configuration;
84
+ if (portable) {
85
+ config + = " _Portable" ;
86
+ }
87
+ def newJobName = Utilities . getFullJobName(project, " ${ os} _${ config} " , true );
84
88
def contextString = " ${ os} ${ configuration} " ;
89
+ if (portable) {
90
+ contextString + = " Portable" ;
91
+ }
85
92
def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
86
93
87
94
def newJob = job(newJobName);
88
95
89
- addBuildStepsAndSetMachineAffinity(newJob, os, configuration);
96
+ addBuildStepsAndSetMachineAffinity(newJob, os, configuration, portable );
90
97
addArchival(newJob);
91
98
Utilities . standardJobSetup(newJob, project, true , " */${ branch} " );
92
99
Utilities . setJobTimeout(newJob, 180 );
93
100
Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString, triggerPhrase, ! runByDefault);
94
101
}
95
102
96
- def addPushJob (String project , String branch , String os , String configuration )
103
+ def addPushJob (String project , String branch , String os , String configuration , boolean portable )
97
104
{
98
105
def shortJobName = " ${ os} _${ configuration} " ;
106
+ if (portable) {
107
+ shortJobName + = " _Portable" ;
108
+ }
99
109
100
110
def newJobName = Utilities . getFullJobName(project, shortJobName, false );
101
111
def newJob = job(newJobName);
102
112
103
- addBuildStepsAndSetMachineAffinity(newJob, os, configuration);
113
+ addBuildStepsAndSetMachineAffinity(newJob, os, configuration, portable );
104
114
addArchival(newJob);
105
115
Utilities . standardJobSetup(newJob, project, false , " */${ branch} " );
106
116
Utilities . setJobTimeout(newJob, 180 );
107
117
Utilities . addGithubPushTrigger(newJob);
108
118
}
109
119
110
120
[" Ubuntu16.04" , " Fedora24" , " Debian8.4" , " RHEL7.2" , " CentOS7.1" , " OSX10.12" ]. each { os ->
111
- addPullRequestJob(project, branch, os, " Release" , true );
112
- addPullRequestJob(project, branch, os, " Debug" , false );
121
+ // Release non-portable run by default
122
+ addPullRequestJob(project, branch, os, " Release" , false , true );
123
+ // Debug non-portable can be triggered
124
+ addPullRequestJob(project, branch, os, " Debug" , false , false );
125
+ // Release portable can be triggered
126
+ addPullRequestJob(project, branch, os, " Release" , true , false );
127
+ // Debug portable can be triggered
128
+ addPullRequestJob(project, branch, os, " Debug" , true , false );
113
129
};
114
130
115
131
// Per push, run all the jobs
116
132
[" Ubuntu16.04" , " Fedora24" , " Debian8.4" , " RHEL7.2" , " Windows_NT" , " CentOS7.1" , " OSX10.12" ]. each { os ->
117
133
[" Release" , " Debug" ]. each { configuration ->
118
- addPushJob(project, branch, os, configuration);
134
+ [true , false ]. each { portable ->
135
+ addPushJob(project, branch, os, configuration, portable);
136
+ };
119
137
};
120
138
};
121
139
122
140
// Tarball builds that are not enforced to be offline
123
141
[true , false ]. each { isPR ->
124
142
[" RHEL7.2" , " CentOS7.1" ]. each { os ->
125
143
[" Release" , " Debug" ]. each { configuration ->
144
+ [true , false ]. each { portable ->
126
145
127
- def shortJobName = " ${ os} _Tarball_${ configuration} " ;
128
- def contextString = " ${ os} Tarball ${ configuration} " ;
129
- def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
146
+ def shortJobName = " ${ os} _Tarball_${ configuration} " ;
147
+ def contextString = " ${ os} Tarball ${ configuration} " ;
130
148
131
- def newJob = job(Utilities . getFullJobName(project, shortJobName, isPR)){
132
- steps{
133
- shell(" cd ./source-build;git submodule update --init --recursive" );
134
- shell(" cd ./source-build;./build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${ configuration} ${ loggingOptions} " );
135
- shell(" cd ./source-build;./build-source-tarball.sh ../tarball-output --skip-build" );
149
+ if (portable) {
150
+ shortJobName + = " _Portable"
151
+ contextString + = " Portable"
152
+ }
136
153
137
- shell(" cd ./tarball-output;./build.sh /p:Configuration=${ configuration} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " )
138
- shell(" cd ./tarball-output;./smoke-test.sh --minimal --configuration ${ configuration} " )
154
+ def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
155
+
156
+ def newJob = job(Utilities . getFullJobName(project, shortJobName, isPR)){
157
+ steps{
158
+ shell(" cd ./source-build;git submodule update --init --recursive" );
159
+ shell(" cd ./source-build;./build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${ configuration} /p:PortableBuild=${ portable} ${ loggingOptions} " );
160
+ shell(" cd ./source-build;./build-source-tarball.sh ../tarball-output --skip-build" );
161
+
162
+ shell(" cd ./tarball-output;./build.sh /p:Configuration=${ configuration} /p:PortableBuild=${ portable} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " )
163
+ shell(" cd ./tarball-output;./smoke-test.sh --minimal --configuration ${ configuration} " )
164
+ }
139
165
}
140
- }
141
166
142
- setMachineAffinity(newJob, os);
167
+ setMachineAffinity(newJob, os);
143
168
144
- Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
169
+ Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
145
170
146
- // Increase timeout. The tarball builds can take longer than the 2 hour default.
147
- Utilities . setJobTimeout(newJob, 240 );
171
+ // Increase timeout. The tarball builds can take longer than the 2 hour default.
172
+ Utilities . setJobTimeout(newJob, 240 );
148
173
149
- // Clone into the source-build directory
150
- Utilities . addScmInSubDirectory(newJob, project, isPR, ' source-build' );
174
+ // Clone into the source-build directory
175
+ Utilities . addScmInSubDirectory(newJob, project, isPR, ' source-build' );
151
176
152
- addArchival(newJob);
153
- if (isPR){
154
- if (configuration == " Release" ){
155
- Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString);
177
+ addArchival(newJob);
178
+ if (isPR){
179
+ if (configuration == " Release" ){
180
+ Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString);
181
+ }
182
+ else {
183
+ Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString, triggerPhrase);
184
+ }
156
185
}
157
186
else {
158
- Utilities . addGithubPRTriggerForBranch (newJob, branch, contextString, triggerPhrase );
187
+ Utilities . addGithubPushTrigger (newJob);
159
188
}
160
- }
161
- else {
162
- Utilities . addGithubPushTrigger(newJob);
163
- }
164
189
190
+ }
165
191
}
166
192
}
167
193
}
@@ -170,52 +196,60 @@ def addPushJob(String project, String branch, String os, String configuration)
170
196
[true , false ]. each { isPR ->
171
197
[" RHEL7.2" , " CentOS7.1" ]. each { os ->
172
198
[" Release" , " Debug" ]. each { configuration ->
199
+ [true , false ]. each { portable ->
200
+
201
+ def shortJobName = " ${ os} _Unshared_${ configuration} " ;
202
+ def contextString = " ${ os} Unshared ${ configuration} " ;
173
203
174
- def shortJobName = " ${ os} _Unshared_${ configuration} " ;
175
- def contextString = " ${ os} Unshared ${ configuration} " ;
176
- def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
177
- def imageName = getDockerImageForOs(os);
178
-
179
- def newJob = job(Utilities . getFullJobName(project, shortJobName, isPR)){
180
- steps{
181
- shell(" cd ./source-build;git submodule update --init --recursive" );
182
- // First build the product itself
183
- shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home -v \$ (pwd)/source-build:/opt/code --rm -w /opt/code ${ imageName} /opt/code/build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${ configuration} ${ loggingOptions} " );
184
- // Have to make this directory before volume-sharing it unlike non-docker build - existing directory is really only a warning in build-source-tarball.sh
185
- shell(" mkdir tarball-output" );
186
- // now build the tarball
187
- shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home --network none -v \$ (pwd)/source-build:/opt/code -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/code ${ imageName} /opt/code/build-source-tarball.sh /opt/tarball --skip-build" );
188
- // now build from the tarball offline and without access to the regular non-tarball build
189
- shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home --network none -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${ imageName} /opt/tarball/build.sh /p:Configuration=${ configuration} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " );
190
- // finally, run a smoke-test on the result
191
- shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${ imageName} /opt/tarball/smoke-test.sh --minimal --configuration ${ configuration} " );
204
+ if (portable) {
205
+ shortJobName + = " _Portable"
206
+ contextString + = " Portable"
192
207
}
193
- }
194
208
195
- // Only Ubuntu Jenkins machines have Docker
196
- setMachineAffinity(newJob, " Ubuntu16.04" );
209
+ def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
210
+ def imageName = getDockerImageForOs(os);
211
+
212
+ def newJob = job(Utilities . getFullJobName(project, shortJobName, isPR)){
213
+ steps{
214
+ shell(" cd ./source-build;git submodule update --init --recursive" );
215
+ // First build the product itself
216
+ shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home -v \$ (pwd)/source-build:/opt/code --rm -w /opt/code ${ imageName} /opt/code/build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${ configuration} /p:PortableBuild=${ portable} /p:ContinueOnPrebuiltBaselineError=true ${ loggingOptions} " );
217
+ // Have to make this directory before volume-sharing it unlike non-docker build - existing directory is really only a warning in build-source-tarball.sh
218
+ shell(" mkdir tarball-output" );
219
+ // now build the tarball
220
+ shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home --network none -v \$ (pwd)/source-build:/opt/code -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/code ${ imageName} /opt/code/build-source-tarball.sh /opt/tarball --skip-build" );
221
+ // now build from the tarball offline and without access to the regular non-tarball build
222
+ shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home --network none -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${ imageName} /opt/tarball/build.sh /p:Configuration=${ configuration} /p:PortableBuild=${ portable} /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " );
223
+ // finally, run a smoke-test on the result
224
+ shell(" docker run -u=\"\$ (id -u):\$ (id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home -v \$ (pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${ imageName} /opt/tarball/smoke-test.sh --minimal --configuration ${ configuration} " );
225
+ }
226
+ }
197
227
198
- Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
228
+ // Only Ubuntu Jenkins machines have Docker
229
+ setMachineAffinity(newJob, " Ubuntu16.04" );
199
230
200
- // Increase timeout. The offline build in Docker takes more than 2 hours.
201
- Utilities . setJobTimeout(newJob, 240 );
231
+ Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
202
232
203
- // Clone into the source- build directory
204
- Utilities . addScmInSubDirectory (newJob, project, isPR, ' source-build ' );
233
+ // Increase timeout. The offline build in Docker takes more than 2 hours.
234
+ Utilities . setJobTimeout (newJob, 240 );
205
235
206
- addArchival(newJob);
207
- if (isPR){
208
- if (configuration == " Release" ){
209
- Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString);
236
+ // Clone into the source-build directory
237
+ Utilities . addScmInSubDirectory(newJob, project, isPR, ' source-build' );
238
+
239
+ addArchival(newJob);
240
+ if (isPR){
241
+ if (configuration == " Release" ){
242
+ Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString);
243
+ }
244
+ else {
245
+ Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString, triggerPhrase);
246
+ }
210
247
}
211
248
else {
212
- Utilities . addGithubPRTriggerForBranch (newJob, branch, contextString, triggerPhrase );
249
+ Utilities . addGithubPushTrigger (newJob);
213
250
}
214
- }
215
- else {
216
- Utilities . addGithubPushTrigger(newJob);
217
- }
218
251
252
+ }
219
253
}
220
254
}
221
255
}
0 commit comments