| Line 52... |
Line 52... |
| 52 |
|
52 |
|
| 53 |
while(!exit)
|
53 |
while(!exit)
|
| 54 |
{
|
54 |
{
|
| 55 |
try
|
55 |
try
|
| 56 |
{
|
56 |
{
|
| - |
|
57 |
rippleEngine.collectMetaData();
|
| - |
|
58 |
|
| 57 |
if ( Thread.currentThread().isInterrupted() )
|
59 |
if ( Thread.currentThread().isInterrupted() )
|
| 58 |
{
|
60 |
{
|
| 59 |
mLogger.warn("run is interrupted");
|
61 |
mLogger.warn("run is interrupted");
|
| 60 |
// unit test technique
|
62 |
// unit test technique
|
| 61 |
throw new ExitException();
|
63 |
throw new ExitException();
|
| Line 74... |
Line 76... |
| 74 |
if ( mGbebuildfilter.compareTo("unit test generate build files") != 0)
|
76 |
if ( mGbebuildfilter.compareTo("unit test generate build files") != 0)
|
| 75 |
{
|
77 |
{
|
| 76 |
if ( mGbebuildfilter.compareTo("unit test coordinate slave threads") != 0 )
|
78 |
if ( mGbebuildfilter.compareTo("unit test coordinate slave threads") != 0 )
|
| 77 |
{
|
79 |
{
|
| 78 |
mLogger.warn("run checking allowedToProceed");
|
80 |
mLogger.warn("run checking allowedToProceed");
|
| 79 |
allowedToProceed();
|
81 |
allowedToProceed(true);
|
| 80 |
mLogger.info("run allowedToProceed returned");
|
82 |
mLogger.info("run allowedToProceed returned");
|
| 81 |
|
83 |
|
| 82 |
if ( mGbebuildfilter.compareTo("unit test allowed to proceed") == 0 )
|
84 |
if ( mGbebuildfilter.compareTo("unit test allowed to proceed") == 0 )
|
| 83 |
{
|
85 |
{
|
| 84 |
throw new ExitException();
|
86 |
throw new ExitException();
|
| Line 185... |
Line 187... |
| 185 |
buildErrorOccurred = false;
|
187 |
buildErrorOccurred = false;
|
| 186 |
|
188 |
|
| 187 |
if ( reportingNewLabel.length() > 0 )
|
189 |
if ( reportingNewLabel.length() > 0 )
|
| 188 |
{
|
190 |
{
|
| 189 |
Integer rtagId = new Integer(mRtagId);
|
191 |
Integer rtagId = new Integer(mRtagId);
|
| 190 |
|
- |
|
| 191 |
if ( mReportingDoesNotRequireSourceControlInteraction.compareTo("false") == 0 )
|
- |
|
| 192 |
{
|
192 |
|
| 193 |
// requires source control interaction ie labelled in ClearCase
|
- |
|
| 194 |
// publish to release manager
|
193 |
if ( mGbeGatherMetricsOnly == null )
|
| 195 |
mReleaseManager.autoMakeRelease(rtagId.toString(), mReportingPackageName, mReportingPackageExtension, mReportingPackageVersion, reportingNewLabel, mReportingPackageDepends, mReportingIsRipple);
|
- |
|
| 196 |
}
|
- |
|
| 197 |
else
|
- |
|
| 198 |
{
|
194 |
{
|
| - |
|
195 |
if ( mReportingDoesNotRequireSourceControlInteraction.compareTo("false") == 0 )
|
| - |
|
196 |
{
|
| - |
|
197 |
// requires source control interaction ie labelled in ClearCase
|
| - |
|
198 |
// publish to release manager
|
| - |
|
199 |
mReleaseManager.autoMakeRelease(rtagId.toString(), mReportingPackageName, mReportingPackageExtension, mReportingPackageVersion, reportingNewLabel, mReportingPackageDepends, mReportingIsRipple);
|
| - |
|
200 |
}
|
| - |
|
201 |
else
|
| - |
|
202 |
{
|
| 199 |
// trigger release note generation and on_make_official.wsf, which changes ownership and write access in the archive
|
203 |
// trigger release note generation and on_make_official.wsf, which changes ownership and write access in the archive
|
| 200 |
// this should not be through autoMakeRelease (sledgehammer, the package is already official in release manager in this scenario)
|
204 |
// this should not be through autoMakeRelease (sledgehammer, the package is already official in release manager in this scenario)
|
| 201 |
// at the time of writing, calling autoMakeRelease does not help if the package was 'released' more than 24 hours ago
|
205 |
// at the time of writing, calling autoMakeRelease does not help if the package was 'released' more than 24 hours ago
|
| 202 |
// this seems to be a business rule in the generate_release_notes package
|
206 |
// this seems to be a business rule in the generate_release_notes package
|
| 203 |
// the buildtool has no option but to call autoMakeRelease at present
|
207 |
// the buildtool has no option but to call autoMakeRelease at present
|
| 204 |
mReleaseManager.autoMakeRelease(rtagId.toString(), mReportingPackageName, mReportingPackageExtension, mReportingPackageVersion, reportingNewLabel, mReportingPackageDepends, mReportingIsRipple);
|
208 |
mReleaseManager.autoMakeRelease(rtagId.toString(), mReportingPackageName, mReportingPackageExtension, mReportingPackageVersion, reportingNewLabel, mReportingPackageDepends, mReportingIsRipple);
|
| - |
|
209 |
}
|
| 205 |
}
|
210 |
}
|
| 206 |
|
211 |
|
| 207 |
FileInputStream abtmetrics = new FileInputStream( rtagId.toString() + "abtmetrics.txt" );
|
212 |
FileInputStream abtmetrics = new FileInputStream( rtagId.toString() + "abtmetrics.txt" );
|
| 208 |
DataInputStream din = new DataInputStream( abtmetrics );
|
213 |
DataInputStream din = new DataInputStream( abtmetrics );
|
| 209 |
InputStreamReader isr = new InputStreamReader( din );
|
214 |
InputStreamReader isr = new InputStreamReader( din );
|
| Line 267... |
Line 272... |
| 267 |
mReleaseManager.excludeFromBuild(mReportingPackageVersionId, mReportingPackageVersion, rtagId.toString(), null, null, mReportingBuildFailureLogFile);
|
272 |
mReleaseManager.excludeFromBuild(mReportingPackageVersionId, mReportingPackageVersion, rtagId.toString(), null, null, mReportingBuildFailureLogFile);
|
| 268 |
|
273 |
|
| 269 |
if ( !buildErrorOccurred )
|
274 |
if ( !buildErrorOccurred )
|
| 270 |
{
|
275 |
{
|
| 271 |
mLogger.fatal("an error occurred publishing to ClearCase or Release Manager");
|
276 |
mLogger.fatal("an error occurred publishing to ClearCase or Release Manager");
|
| 272 |
throw new Exception();
|
277 |
throw new Exception("an error occurred publishing to ClearCase or Release Manager");
|
| 273 |
}
|
278 |
}
|
| 274 |
}
|
279 |
}
|
| 275 |
}
|
280 |
}
|
| 276 |
|
281 |
|
| 277 |
mLogger.info("run coordinate slave threads returned");
|
282 |
mLogger.info("run coordinate slave threads returned");
|
| Line 297... |
Line 302... |
| 297 |
mReleaseManager.publishBuildFile(mRtagId, mDummyBuildFileContent);
|
302 |
mReleaseManager.publishBuildFile(mRtagId, mDummyBuildFileContent);
|
| 298 |
}
|
303 |
}
|
| 299 |
}
|
304 |
}
|
| 300 |
mLogger.info("run generated build files");
|
305 |
mLogger.info("run generated build files");
|
| 301 |
|
306 |
|
| - |
|
307 |
if ( mGbeGatherMetricsOnly != null )
|
| - |
|
308 |
{
|
| - |
|
309 |
// set view up early for metrics gathering to ensure build file is fully written before letting the slave loose
|
| - |
|
310 |
setViewUp(buildFileContent.value, true);
|
| - |
|
311 |
}
|
| - |
|
312 |
|
| 302 |
// change the run level for all threads in associated with the baseline
|
313 |
// change the run level for all threads in associated with the baseline
|
| 303 |
mLogger.warn("run change the run level for all threads in associated with the baseline");
|
314 |
mLogger.warn("run change the run level for all threads in associated with the baseline");
|
| 304 |
mReleaseManager.queryReleaseConfig(mRtagId);
|
315 |
mReleaseManager.queryReleaseConfig(mRtagId);
|
| 305 |
rconId.value = -1;
|
316 |
rconId.value = -1;
|
| 306 |
boolean moreBuildThreadsConfigured = mReleaseManager.getFirstReleaseConfig(rconId);
|
317 |
boolean moreBuildThreadsConfigured = mReleaseManager.getFirstReleaseConfig(rconId);
|
| Line 335... |
Line 346... |
| 335 |
throw new ExitException();
|
346 |
throw new ExitException();
|
| 336 |
}
|
347 |
}
|
| 337 |
|
348 |
|
| 338 |
// deliver change to product baseline
|
349 |
// deliver change to product baseline
|
| 339 |
mLogger.warn("run deliverChange");
|
350 |
mLogger.warn("run deliverChange");
|
| - |
|
351 |
|
| - |
|
352 |
if ( mGbeGatherMetricsOnly == null )
|
| - |
|
353 |
{
|
| 340 |
setViewUp(buildFileContent.value, true);
|
354 |
setViewUp(buildFileContent.value, true);
|
| - |
|
355 |
}
|
| - |
|
356 |
|
| 341 |
deliverChange(null, null, false);
|
357 |
deliverChange(null, null, false);
|
| 342 |
mLogger.info("run deliverChange returned");
|
358 |
mLogger.info("run deliverChange returned");
|
| 343 |
}
|
359 |
}
|
| 344 |
catch( SQLException e )
|
360 |
catch( SQLException e )
|
| 345 |
{
|
361 |
{
|
| Line 357... |
Line 373... |
| 357 |
mLogger.warn("run InterruptedException");
|
373 |
mLogger.warn("run InterruptedException");
|
| 358 |
}
|
374 |
}
|
| 359 |
catch( Exception e )
|
375 |
catch( Exception e )
|
| 360 |
{
|
376 |
{
|
| 361 |
mLogger.error("run indefinitePause");
|
377 |
mLogger.error("run indefinitePause");
|
| 362 |
try
|
- |
|
| 363 |
{
|
- |
|
| 364 |
mReleaseManager.indefinitePause();
|
378 |
String cause = e.getMessage();
|
| 365 |
}
|
379 |
|
| 366 |
catch( Exception f )
|
380 |
if ( cause != null )
|
| 367 |
{
|
381 |
{
|
| - |
|
382 |
try
|
| - |
|
383 |
{
|
| - |
|
384 |
// notify first
|
| - |
|
385 |
// many reasons for indefinite pause, including database related, so do database last
|
| - |
|
386 |
indefinitePause(rippleEngine, cause);
|
| - |
|
387 |
mReleaseManager.indefinitePause();
|
| - |
|
388 |
}
|
| - |
|
389 |
catch( Exception f )
|
| - |
|
390 |
{
|
| 368 |
mLogger.error("run indefinitePause failed");
|
391 |
mLogger.error("run indefinitePause failed");
|
| - |
|
392 |
}
|
| 369 |
}
|
393 |
}
|
| 370 |
}
|
394 |
}
|
| 371 |
|
395 |
|
| 372 |
mSleep = false;
|
396 |
mSleep = false;
|
| 373 |
if ( addendum.value.compareTo("dummy") == 0 )
|
397 |
if ( addendum.value.compareTo("dummy") == 0 )
|