@@ -13,7 +13,9 @@ def addArchival(def job) {
13
13
// Grab these logs from all of those locations.
14
14
[ " " , " source-build/" , " tarball-output/" ]. each { logRoot ->
15
15
archivalSettings. addFiles(" ${ logRoot} bin/logs/*" )
16
- archivalSettings. addFiles(" ${ logRoot} bin/prebuilt-report/*" )
16
+ archivalSettings. addFiles(" ${ logRoot} bin/prebuilt-report/**/*" )
17
+ archivalSettings. addFiles(" ${ logRoot} bin/conflict-report/**/*" )
18
+ archivalSettings. addFiles(" ${ logRoot} bin/msbuild-debug/**/*" )
17
19
archivalSettings. addFiles(" ${ logRoot} src/**/*.binlog" )
18
20
archivalSettings. addFiles(" ${ logRoot} src/**/*.log" )
19
21
archivalSettings. addFiles(" ${ logRoot} init-tools.log" )
@@ -53,16 +55,16 @@ def getDockerImageForOs(os) {
53
55
return imageMap. get(os)
54
56
}
55
57
56
- def addBuildStepsAndSetMachineAffinity (def job , String os , String configuration ) {
58
+ def addBuildStepsAndSetMachineAffinity (def job , String os , String configuration , boolean portable ) {
57
59
job. with {
58
60
steps {
59
61
if (os == " Windows_NT" ) {
60
62
batchFile(" git submodule update --init --recursive" );
61
- batchFile(" .\\ build.cmd /p:Configuration=${ configuration} ${ loggingOptions} " )
63
+ batchFile(" .\\ build.cmd /p:Configuration=${ configuration} /p:PortableBuild= ${ portable } /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " )
62
64
}
63
65
else {
64
66
shell(" git submodule update --init --recursive" );
65
- shell(" ./build.sh /p:Configuration=${ configuration} ${ loggingOptions} " );
67
+ shell(" ./build.sh /p:Configuration=${ configuration} /p:PortableBuild= ${ portable } /p:FailOnPrebuiltBaselineError=true ${ loggingOptions} " );
66
68
smokeTestExcludes = " " ;
67
69
if (os == " Fedora24" || os == " OSX10.12" ) {
68
70
// Dev certs doesn't seem to work in these platforms. https://github.com/dotnet/source-build/issues/560
@@ -76,90 +78,116 @@ def addBuildStepsAndSetMachineAffinity(def job, String os, String configuration)
76
78
setMachineAffinity(job, os);
77
79
}
78
80
79
- 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 )
80
82
{
81
- 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 );
82
88
def contextString = " ${ os} ${ configuration} " ;
89
+ if (portable) {
90
+ contextString + = " Portable" ;
91
+ }
83
92
def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
84
93
85
94
def newJob = job(newJobName);
86
95
87
- addBuildStepsAndSetMachineAffinity(newJob, os, configuration);
96
+ addBuildStepsAndSetMachineAffinity(newJob, os, configuration, portable );
88
97
addArchival(newJob);
89
98
Utilities . standardJobSetup(newJob, project, true , " */${ branch} " );
90
99
Utilities . setJobTimeout(newJob, 180 );
91
100
Utilities . addGithubPRTriggerForBranch(newJob, branch, contextString, triggerPhrase, ! runByDefault);
92
101
}
93
102
94
- def addPushJob (String project , String branch , String os , String configuration )
103
+ def addPushJob (String project , String branch , String os , String configuration , boolean portable )
95
104
{
96
105
def shortJobName = " ${ os} _${ configuration} " ;
106
+ if (portable) {
107
+ shortJobName + = " _Portable" ;
108
+ }
97
109
98
110
def newJobName = Utilities . getFullJobName(project, shortJobName, false );
99
111
def newJob = job(newJobName);
100
112
101
- addBuildStepsAndSetMachineAffinity(newJob, os, configuration);
113
+ addBuildStepsAndSetMachineAffinity(newJob, os, configuration, portable );
102
114
addArchival(newJob);
103
115
Utilities . standardJobSetup(newJob, project, false , " */${ branch} " );
104
116
Utilities . setJobTimeout(newJob, 180 );
105
117
Utilities . addGithubPushTrigger(newJob);
106
118
}
107
119
108
120
[" Ubuntu16.04" , " Fedora24" , " Debian8.4" , " RHEL7.2" , " CentOS7.1" , " OSX10.12" ]. each { os ->
109
- addPullRequestJob(project, branch, os, " Release" , true );
110
- 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 );
111
129
};
112
130
113
131
// Per push, run all the jobs
114
132
[" Ubuntu16.04" , " Fedora24" , " Debian8.4" , " RHEL7.2" , " Windows_NT" , " CentOS7.1" , " OSX10.12" ]. each { os ->
115
133
[" Release" , " Debug" ]. each { configuration ->
116
- addPushJob(project, branch, os, configuration);
134
+ [true , false ]. each { portable ->
135
+ addPushJob(project, branch, os, configuration, portable);
136
+ };
117
137
};
118
138
};
119
139
120
140
// Tarball builds that are not enforced to be offline
121
141
[true , false ]. each { isPR ->
122
142
[" RHEL7.2" , " CentOS7.1" ]. each { os ->
123
143
[" Release" , " Debug" ]. each { configuration ->
144
+ [true , false ]. each { portable ->
124
145
125
- def shortJobName = " ${ os} _Tarball_${ configuration} " ;
126
- def contextString = " ${ os} Tarball ${ configuration} " ;
127
- def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
146
+ def shortJobName = " ${ os} _Tarball_${ configuration} " ;
147
+ def contextString = " ${ os} Tarball ${ configuration} " ;
128
148
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" );
149
+ if (portable) {
150
+ shortJobName + = " _Portable"
151
+ contextString + = " Portable"
152
+ }
134
153
135
- shell(" cd ./tarball-output;./build.sh /p:Configuration=${ configuration} ${ loggingOptions} " )
136
- 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
+ }
137
165
}
138
- }
139
166
140
- setMachineAffinity(newJob, os);
167
+ setMachineAffinity(newJob, os);
141
168
142
- Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
169
+ Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
143
170
144
- // Increase timeout. The tarball builds can take longer than the 2 hour default.
145
- Utilities . setJobTimeout(newJob, 240 );
171
+ // Increase timeout. The tarball builds can take longer than the 2 hour default.
172
+ Utilities . setJobTimeout(newJob, 240 );
146
173
147
- // Clone into the source-build directory
148
- Utilities . addScmInSubDirectory(newJob, project, isPR, ' source-build' );
174
+ // Clone into the source-build directory
175
+ Utilities . addScmInSubDirectory(newJob, project, isPR, ' source-build' );
149
176
150
- addArchival(newJob);
151
- if (isPR){
152
- if (configuration == " Release" ){
153
- 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
+ }
154
185
}
155
186
else {
156
- Utilities . addGithubPRTriggerForBranch (newJob, branch, contextString, triggerPhrase );
187
+ Utilities . addGithubPushTrigger (newJob);
157
188
}
158
- }
159
- else {
160
- Utilities . addGithubPushTrigger(newJob);
161
- }
162
189
190
+ }
163
191
}
164
192
}
165
193
}
@@ -168,52 +196,60 @@ def addPushJob(String project, String branch, String os, String configuration)
168
196
[true , false ]. each { isPR ->
169
197
[" RHEL7.2" , " CentOS7.1" ]. each { os ->
170
198
[" Release" , " Debug" ]. each { configuration ->
199
+ [true , false ]. each { portable ->
200
+
201
+ def shortJobName = " ${ os} _Unshared_${ configuration} " ;
202
+ def contextString = " ${ os} Unshared ${ configuration} " ;
171
203
172
- def shortJobName = " ${ os} _Unshared_${ configuration} " ;
173
- def contextString = " ${ os} Unshared ${ configuration} " ;
174
- def triggerPhrase = " (?i).*test\\ W+${ contextString} .*" ;
175
- def imageName = getDockerImageForOs(os);
176
-
177
- def newJob = job(Utilities . getFullJobName(project, shortJobName, isPR)){
178
- steps{
179
- shell(" cd ./source-build;git submodule update --init --recursive" );
180
- // First build the product itself
181
- 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:ContinueOnPrebuiltBaselineError=true ${ loggingOptions} " );
182
- // 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
183
- shell(" mkdir tarball-output" );
184
- // now build the tarball
185
- 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" );
186
- // now build from the tarball offline and without access to the regular non-tarball build
187
- 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} ${ loggingOptions} " );
188
- // finally, run a smoke-test on the result
189
- 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"
190
207
}
191
- }
192
208
193
- // Only Ubuntu Jenkins machines have Docker
194
- 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
+ }
195
227
196
- Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
228
+ // Only Ubuntu Jenkins machines have Docker
229
+ setMachineAffinity(newJob, " Ubuntu16.04" );
197
230
198
- // Increase timeout. The offline build in Docker takes more than 2 hours.
199
- Utilities . setJobTimeout(newJob, 240 );
231
+ Utilities . standardJobSetup(newJob, project, isPR, " */${ branch} " );
200
232
201
- // Clone into the source- build directory
202
- 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 );
203
235
204
- addArchival(newJob);
205
- if (isPR){
206
- if (configuration == " Release" ){
207
- 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
+ }
208
247
}
209
248
else {
210
- Utilities . addGithubPRTriggerForBranch (newJob, branch, contextString, triggerPhrase );
249
+ Utilities . addGithubPushTrigger (newJob);
211
250
}
212
- }
213
- else {
214
- Utilities . addGithubPushTrigger(newJob);
215
- }
216
251
252
+ }
217
253
}
218
254
}
219
255
}
0 commit comments