| Line 19... |
Line 19... |
| 19 |
import java.io.FileInputStream;
|
19 |
import java.io.FileInputStream;
|
| 20 |
import java.io.InputStreamReader;
|
20 |
import java.io.InputStreamReader;
|
| 21 |
import java.sql.SQLException;
|
21 |
import java.sql.SQLException;
|
| 22 |
import java.util.Iterator;
|
22 |
import java.util.Iterator;
|
| 23 |
|
23 |
|
| 24 |
import org.apache.log4j.Logger;
|
24 |
import org.slf4j.Logger;
|
| - |
|
25 |
import org.slf4j.LoggerFactory;
|
| 25 |
|
26 |
|
| 26 |
/**Master Thread sub component
|
27 |
/**Master Thread sub component
|
| 27 |
*/
|
28 |
*/
|
| 28 |
public class MasterThread extends BuildThread
|
29 |
public class MasterThread extends BuildThread
|
| 29 |
{
|
30 |
{
|
| 30 |
|
31 |
|
| 31 |
/**Logger
|
32 |
/**Logger
|
| 32 |
* @attribute
|
33 |
* @attribute
|
| 33 |
*/
|
34 |
*/
|
| 34 |
private static final Logger mLogger = Logger.getLogger(MasterThread.class);
|
35 |
private static final Logger mLogger = LoggerFactory.getLogger(MasterThread.class);
|
| 35 |
|
36 |
|
| 36 |
/** Current BuildFile
|
37 |
/** Current BuildFile
|
| 37 |
*
|
38 |
*
|
| 38 |
*/
|
39 |
*/
|
| 39 |
private BuildFile mMasterBuildFile = new BuildFile();
|
40 |
private BuildFile mMasterBuildFile = new BuildFile();
|
| Line 67... |
Line 68... |
| 67 |
|
68 |
|
| 68 |
while(!exit)
|
69 |
while(!exit)
|
| 69 |
{
|
70 |
{
|
| 70 |
try
|
71 |
try
|
| 71 |
{
|
72 |
{
|
| 72 |
mLogger.fatal("run calling sleepCheck");
|
73 |
mLogger.error("run calling sleepCheck");
|
| 73 |
mPhase.setPhase("sleepCheck");
|
74 |
mPhase.setPhase("sleepCheck");
|
| 74 |
sleepCheck();
|
75 |
sleepCheck();
|
| 75 |
|
76 |
|
| 76 |
mLogger.fatal("run calling rippleEngine.collectMetaData");
|
77 |
mLogger.error("run calling rippleEngine.collectMetaData");
|
| 77 |
mPhase.setPhase("collectMetaData", 600);
|
78 |
mPhase.setPhase("collectMetaData", 600);
|
| 78 |
mRippleEngine.collectMetaData();
|
79 |
mRippleEngine.collectMetaData();
|
| 79 |
|
80 |
|
| 80 |
if ( Thread.currentThread().isInterrupted() )
|
81 |
if ( Thread.currentThread().isInterrupted() )
|
| 81 |
{
|
82 |
{
|
| Line 100... |
Line 101... |
| 100 |
//---------------------------------------------------------------
|
101 |
//---------------------------------------------------------------
|
| 101 |
// Wait for all Slaves to enter waiting or paused state
|
102 |
// Wait for all Slaves to enter waiting or paused state
|
| 102 |
// They may be building
|
103 |
// They may be building
|
| 103 |
// They may be starting up
|
104 |
// They may be starting up
|
| 104 |
//
|
105 |
//
|
| 105 |
mLogger.fatal("run changing run level to WAITING (New) for rcon_id " + mRconId);
|
106 |
mLogger.error("run changing run level to WAITING (New) for rcon_id " + mRconId);
|
| 106 |
mPhase.setPhase("Wait for Slave Threads");
|
107 |
mPhase.setPhase("Wait for Slave Threads");
|
| 107 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_WAITING);
|
108 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_WAITING);
|
| 108 |
|
109 |
|
| 109 |
while (true)
|
110 |
while (true)
|
| 110 |
{
|
111 |
{
|
| Line 188... |
Line 189... |
| 188 |
// Publish Package Build Results
|
189 |
// Publish Package Build Results
|
| 189 |
// Indicate to RM that we are publishing
|
190 |
// Indicate to RM that we are publishing
|
| 190 |
// Ensure that all build machines have placed a marker in dpkg_archive
|
191 |
// Ensure that all build machines have placed a marker in dpkg_archive
|
| 191 |
// Save updated build files into VCS
|
192 |
// Save updated build files into VCS
|
| 192 |
//
|
193 |
//
|
| 193 |
mLogger.fatal("run changing run level to PUBLISHING for rcon_id " + mRconId);
|
194 |
mLogger.error("run changing run level to PUBLISHING for rcon_id " + mRconId);
|
| 194 |
mPhase.setPhase("Publishing");
|
195 |
mPhase.setPhase("Publishing");
|
| 195 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PUBLISHING);
|
196 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PUBLISHING);
|
| 196 |
|
197 |
|
| 197 |
mLogger.info("run calling deliverChange on AbtPublish");
|
198 |
mLogger.info("run calling deliverChange on AbtPublish");
|
| 198 |
deliverChange("AbtPublish", true, false);
|
199 |
deliverChange("AbtPublish", true, false);
|
| Line 254... |
Line 255... |
| 254 |
mLogger.info("run completing test build on " + mReporting.packageName + mReporting.packageExtension);
|
255 |
mLogger.info("run completing test build on " + mReporting.packageName + mReporting.packageExtension);
|
| 255 |
mPhase.setPhase("Report Test Build Complete");
|
256 |
mPhase.setPhase("Report Test Build Complete");
|
| 256 |
Package p = mRippleEngine.findPackage(mReporting.packageName + mReporting.packageExtension);
|
257 |
Package p = mRippleEngine.findPackage(mReporting.packageName + mReporting.packageExtension);
|
| 257 |
if (p != ReleaseManager.NULL_PACKAGE)
|
258 |
if (p != ReleaseManager.NULL_PACKAGE)
|
| 258 |
{
|
259 |
{
|
| 259 |
mLogger.fatal("run calling p.completeTestBuild");
|
260 |
mLogger.error("run calling p.completeTestBuild");
|
| 260 |
p.completeTestBuild(mRippleEngine, mReporting.isFullyPublished);
|
261 |
p.completeTestBuild(mRippleEngine, mReporting.isFullyPublished);
|
| 261 |
}
|
262 |
}
|
| 262 |
|
263 |
|
| 263 |
//
|
264 |
//
|
| 264 |
// Determine the total time taken by the build
|
265 |
// Determine the total time taken by the build
|
| Line 268... |
Line 269... |
| 268 |
// Only record for successful tests. Don't want to record short build times on failure
|
269 |
// Only record for successful tests. Don't want to record short build times on failure
|
| 269 |
// in particular if the package has been released. Would be OK for a WIP, but how to identify these
|
270 |
// in particular if the package has been released. Would be OK for a WIP, but how to identify these
|
| 270 |
if ( mReporting.isFullyPublished)
|
271 |
if ( mReporting.isFullyPublished)
|
| 271 |
{
|
272 |
{
|
| 272 |
int buildDuration = mBuildDuration.toIntSecs();
|
273 |
int buildDuration = mBuildDuration.toIntSecs();
|
| 273 |
mLogger.fatal("Build Duration:" + buildDuration);
|
274 |
mLogger.error("Build Duration:" + buildDuration);
|
| 274 |
mReleaseManager.updateBuildDuration(mReporting.packageVersionId, buildDuration);
|
275 |
mReleaseManager.updateBuildDuration(mReporting.packageVersionId, buildDuration);
|
| 275 |
}
|
276 |
}
|
| 276 |
|
277 |
|
| 277 |
mPhase.setPhase("Update Build Instance for Test");
|
278 |
mPhase.setPhase("Update Build Instance for Test");
|
| 278 |
mReleaseManager.updateBuildInstance(mReporting.buildId, 0, mReporting.isFullyPublished ? BuildResult.Complete :BuildResult.BuildError );
|
279 |
mReleaseManager.updateBuildInstance(mReporting.buildId, 0, mReporting.isFullyPublished ? BuildResult.Complete :BuildResult.BuildError );
|
| Line 305... |
Line 306... |
| 305 |
// Have had zero length values returned
|
306 |
// Have had zero length values returned
|
| 306 |
// Treat as a publishing error
|
307 |
// Treat as a publishing error
|
| 307 |
//
|
308 |
//
|
| 308 |
if ( mReporting.newVcsTag == null || mReporting.newVcsTag.isEmpty() )
|
309 |
if ( mReporting.newVcsTag == null || mReporting.newVcsTag.isEmpty() )
|
| 309 |
{
|
310 |
{
|
| 310 |
mLogger.fatal("run package not labelled in Version Control on " + mReporting.packageName + mReporting.packageVersion);
|
311 |
mLogger.error("run package not labelled in Version Control on " + mReporting.packageName + mReporting.packageVersion);
|
| 311 |
mReporting.errMsg = "Error publishing to Version Control System"; // Max 50 Characters
|
312 |
mReporting.errMsg = "Error publishing to Version Control System"; // Max 50 Characters
|
| 312 |
throw new Exception();
|
313 |
throw new Exception();
|
| 313 |
}
|
314 |
}
|
| 314 |
|
315 |
|
| 315 |
|
316 |
|
| 316 |
// Publish to release manager
|
317 |
// Publish to release manager
|
| 317 |
// On error mReporting.errMsg will contain error string
|
318 |
// On error mReporting.errMsg will contain error string
|
| 318 |
// Publishing errors only affect the current package
|
319 |
// Publishing errors only affect the current package
|
| 319 |
//
|
320 |
//
|
| 320 |
mLogger.fatal("run calling mReleaseManager.autoMakeRelease");
|
321 |
mLogger.error("run calling mReleaseManager.autoMakeRelease");
|
| 321 |
mPhase.setPhase("autoMakeRelease");
|
322 |
mPhase.setPhase("autoMakeRelease");
|
| 322 |
publishError = mReleaseManager.autoMakeRelease(mReporting);
|
323 |
publishError = mReleaseManager.autoMakeRelease(mReporting);
|
| 323 |
if ( publishError )
|
324 |
if ( publishError )
|
| 324 |
{
|
325 |
{
|
| 325 |
mLogger.fatal("autoMakeRelease publishError: " + mReporting.errMsg);
|
326 |
mLogger.error("autoMakeRelease publishError: " + mReporting.errMsg);
|
| 326 |
throw new Exception();
|
327 |
throw new Exception();
|
| 327 |
}
|
328 |
}
|
| 328 |
|
329 |
|
| 329 |
//
|
330 |
//
|
| 330 |
// Determine the total time taken by the build
|
331 |
// Determine the total time taken by the build
|
| 331 |
// Done as late a possible in the process
|
332 |
// Done as late a possible in the process
|
| 332 |
// Does not include planning time
|
333 |
// Does not include planning time
|
| 333 |
// Does not handle case where build cycle is broken
|
334 |
// Does not handle case where build cycle is broken
|
| 334 |
//
|
335 |
//
|
| 335 |
int buildDuration = mBuildDuration.toIntSecs();
|
336 |
int buildDuration = mBuildDuration.toIntSecs();
|
| 336 |
mLogger.fatal("Build Duration:" + buildDuration);
|
337 |
mLogger.error("Build Duration:" + buildDuration);
|
| 337 |
mReleaseManager.updateBuildDuration(mReporting.packageVersionId, buildDuration);
|
338 |
mReleaseManager.updateBuildDuration(mReporting.packageVersionId, buildDuration);
|
| 338 |
|
339 |
|
| 339 |
//
|
340 |
//
|
| 340 |
// Update the Build Instance information
|
341 |
// Update the Build Instance information
|
| 341 |
// If this has been a ripple then the pv_id of the build needs to be associated with
|
342 |
// If this has been a ripple then the pv_id of the build needs to be associated with
|
| Line 358... |
Line 359... |
| 358 |
mLogger.warn( "execute read metrics string " + metrics );
|
359 |
mLogger.warn( "execute read metrics string " + metrics );
|
| 359 |
br.close();
|
360 |
br.close();
|
| 360 |
isr.close();
|
361 |
isr.close();
|
| 361 |
din.close();
|
362 |
din.close();
|
| 362 |
|
363 |
|
| 363 |
mLogger.fatal("run calling mReleaseManager.insertPackageMetrics");
|
364 |
mLogger.error("run calling mReleaseManager.insertPackageMetrics");
|
| 364 |
mReleaseManager.insertPackageMetrics(mRtagId, mReporting.packageName, mReporting.packageExtension, metrics );
|
365 |
mReleaseManager.insertPackageMetrics(mRtagId, mReporting.packageName, mReporting.packageExtension, metrics );
|
| 365 |
|
366 |
|
| 366 |
//
|
367 |
//
|
| 367 |
// Info reporting
|
368 |
// Info reporting
|
| 368 |
// Send an email to track build system usage - may be noise
|
369 |
// Send an email to track build system usage - may be noise
|
| 369 |
//
|
370 |
//
|
| 370 |
mReporting.errMsg = null;
|
371 |
mReporting.errMsg = null;
|
| 371 |
mLogger.fatal("run calling emailBuildComplete");
|
372 |
mLogger.error("run calling emailBuildComplete");
|
| 372 |
mPhase.setPhase("Post Build Email");
|
373 |
mPhase.setPhase("Post Build Email");
|
| 373 |
emailPostBuild(mRippleEngine, false);
|
374 |
emailPostBuild(mRippleEngine, false);
|
| 374 |
|
375 |
|
| 375 |
//---------------------------------------------------------------
|
376 |
//---------------------------------------------------------------
|
| 376 |
// All done
|
377 |
// All done
|
| Line 424... |
Line 425... |
| 424 |
|
425 |
|
| 425 |
//
|
426 |
//
|
| 426 |
// Delete the dpkg_archive entry - the package is a dud
|
427 |
// Delete the dpkg_archive entry - the package is a dud
|
| 427 |
//
|
428 |
//
|
| 428 |
mPhase.setPhase("Delete package from archive");
|
429 |
mPhase.setPhase("Delete package from archive");
|
| 429 |
mLogger.fatal("Delete package from archive");
|
430 |
mLogger.error("Delete package from archive");
|
| 430 |
deletePackageVersion();
|
431 |
deletePackageVersion();
|
| 431 |
|
432 |
|
| 432 |
// A publishing error. The error occurred, after the build, in the RM publishing
|
433 |
// A publishing error. The error occurred, after the build, in the RM publishing
|
| 433 |
// We won't have a log file, but we will have a rootCause
|
434 |
// We won't have a log file, but we will have a rootCause
|
| 434 |
// Exclude package from the build
|
435 |
// Exclude package from the build
|
| 435 |
// Unless its a test build (handled within mReleaseManager.excludeFromBuild)
|
436 |
// Unless its a test build (handled within mReleaseManager.excludeFromBuild)
|
| 436 |
//
|
437 |
//
|
| 437 |
if ( publishError )
|
438 |
if ( publishError )
|
| 438 |
{
|
439 |
{
|
| 439 |
mLogger.fatal("an error occurred publishing to Version Control or Release Manager");
|
440 |
mLogger.error("an error occurred publishing to Version Control or Release Manager");
|
| 440 |
|
441 |
|
| 441 |
// Post Build Error
|
442 |
// Post Build Error
|
| 442 |
// eMails have not been sent by the ABT class as the error has occurred outside of that process
|
443 |
// eMails have not been sent by the ABT class as the error has occurred outside of that process
|
| 443 |
mPhase.setPhase("Post Build Failure Email");
|
444 |
mPhase.setPhase("Post Build Failure Email");
|
| 444 |
emailPostBuild(mRippleEngine, true);
|
445 |
emailPostBuild(mRippleEngine, true);
|
| 445 |
|
446 |
|
| 446 |
mLogger.fatal("run calling excludeFromBuild");
|
447 |
mLogger.error("run calling excludeFromBuild");
|
| 447 |
mPhase.setPhase("Excluded from build");
|
448 |
mPhase.setPhase("Excluded from build");
|
| 448 |
mReleaseManager.excludeFromBuild(false,
|
449 |
mReleaseManager.excludeFromBuild(false,
|
| 449 |
mReporting.packageVersionId,
|
450 |
mReporting.packageVersionId,
|
| 450 |
null,
|
451 |
null,
|
| 451 |
mReporting.rtagId,
|
452 |
mReporting.rtagId,
|
| Line 471... |
Line 472... |
| 471 |
|
472 |
|
| 472 |
// If we have a log file, then provide it to the user, else insert a generic message
|
473 |
// If we have a log file, then provide it to the user, else insert a generic message
|
| 473 |
|
474 |
|
| 474 |
mReporting.errMsg = (mReporting.buildFailureLogFile == null) ? "Buildtool env error occurred. Attempt build again" : null;
|
475 |
mReporting.errMsg = (mReporting.buildFailureLogFile == null) ? "Buildtool env error occurred. Attempt build again" : null;
|
| 475 |
|
476 |
|
| 476 |
mLogger.fatal("run calling excludeFromBuild");
|
477 |
mLogger.error("run calling excludeFromBuild");
|
| 477 |
mPhase.setPhase("Excluded from build");
|
478 |
mPhase.setPhase("Excluded from build");
|
| 478 |
mReleaseManager.excludeFromBuild(false,
|
479 |
mReleaseManager.excludeFromBuild(false,
|
| 479 |
mReporting.packageVersionId,
|
480 |
mReporting.packageVersionId,
|
| 480 |
mReporting.packageVersion,
|
481 |
mReporting.packageVersion,
|
| 481 |
mReporting.rtagId,
|
482 |
mReporting.rtagId,
|
| Line 506... |
Line 507... |
| 506 |
//---------------------------------------------------------------
|
507 |
//---------------------------------------------------------------
|
| 507 |
// Start of a new build cycle
|
508 |
// Start of a new build cycle
|
| 508 |
// Determine if the daemon has been paused.
|
509 |
// Determine if the daemon has been paused.
|
| 509 |
// Set RunLevel.IDLE (within allowedToProceed)
|
510 |
// Set RunLevel.IDLE (within allowedToProceed)
|
| 510 |
//
|
511 |
//
|
| 511 |
mLogger.fatal("run calling allowedToProceed");
|
512 |
mLogger.error("run calling allowedToProceed");
|
| 512 |
mPhase.setPhase("allowedToProceed");
|
513 |
mPhase.setPhase("allowedToProceed");
|
| 513 |
mReleaseManager.discardVersion();
|
514 |
mReleaseManager.discardVersion();
|
| 514 |
mReleaseManager.clearCurrentPackageBeingBuilt(mRconId);
|
515 |
mReleaseManager.clearCurrentPackageBeingBuilt(mRconId);
|
| 515 |
allowedToProceed(true);
|
516 |
allowedToProceed(true);
|
| 516 |
mLogger.info("run allowedToProceed returned");
|
517 |
mLogger.info("run allowedToProceed returned");
|
| Line 520... |
Line 521... |
| 520 |
throw new ExitException();
|
521 |
throw new ExitException();
|
| 521 |
}
|
522 |
}
|
| 522 |
|
523 |
|
| 523 |
// Set up mReleaseConfigCollection
|
524 |
// Set up mReleaseConfigCollection
|
| 524 |
// This will be used when creating a build file
|
525 |
// This will be used when creating a build file
|
| 525 |
mLogger.fatal("Collect fresh MetaData");
|
526 |
mLogger.error("Collect fresh MetaData");
|
| 526 |
mPhase.setPhase("collectMetaData");
|
527 |
mPhase.setPhase("collectMetaData");
|
| 527 |
mRippleEngine.collectMetaData();
|
528 |
mRippleEngine.collectMetaData();
|
| 528 |
|
529 |
|
| 529 |
//---------------------------------------------------------------
|
530 |
//---------------------------------------------------------------
|
| 530 |
// Plan the next build
|
531 |
// Plan the next build
|
| 531 |
// Snap current Release Sequence Number
|
532 |
// Snap current Release Sequence Number
|
| 532 |
// Determine what is to be built
|
533 |
// Determine what is to be built
|
| 533 |
// Generate build files
|
534 |
// Generate build files
|
| 534 |
mLogger.fatal("run calling planRelease");
|
535 |
mLogger.error("run calling planRelease");
|
| 535 |
mPhase.setPhase("Plan Release", 600);
|
536 |
mPhase.setPhase("Plan Release", 600);
|
| 536 |
mReleaseSeqNum = mReleaseManager.queryReleaseSeqNum(mRtagId, mRconId, BuildDaemon.mHostname);
|
537 |
mReleaseSeqNum = mReleaseManager.queryReleaseSeqNum(mRtagId, mRconId, BuildDaemon.mHostname);
|
| 537 |
mRippleEngine.planRelease(!mLastBuildWasBenign);
|
538 |
mRippleEngine.planRelease(!mLastBuildWasBenign);
|
| 538 |
|
539 |
|
| 539 |
// get the build file from the ripple engine
|
540 |
// get the build file from the ripple engine
|
| Line 546... |
Line 547... |
| 546 |
//---------------------------------------------------------------
|
547 |
//---------------------------------------------------------------
|
| 547 |
// Check that we are good to proceed with the build
|
548 |
// Check that we are good to proceed with the build
|
| 548 |
// Check environment
|
549 |
// Check environment
|
| 549 |
// Ensure we have enough disk space
|
550 |
// Ensure we have enough disk space
|
| 550 |
//
|
551 |
//
|
| 551 |
mLogger.fatal("run calling checkEnvironment");
|
552 |
mLogger.error("run calling checkEnvironment");
|
| 552 |
mPhase.setPhase("checkEnvironment");
|
553 |
mPhase.setPhase("checkEnvironment");
|
| 553 |
checkEnvironment();
|
554 |
checkEnvironment();
|
| 554 |
mLogger.info("run checkEnvironment returned");
|
555 |
mLogger.info("run checkEnvironment returned");
|
| 555 |
|
556 |
|
| 556 |
if ( mUnitTest.startsWith("unit test check environment") )
|
557 |
if ( mUnitTest.startsWith("unit test check environment") )
|
| Line 566... |
Line 567... |
| 566 |
mReporting.resetData();
|
567 |
mReporting.resetData();
|
| 567 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_ACTIVE);
|
568 |
mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_ACTIVE);
|
| 568 |
mReleaseManager.setCurrentPackageBeingBuilt(mRconId, mMasterBuildFile.mPkgId, mMasterBuildFile.mPvId);
|
569 |
mReleaseManager.setCurrentPackageBeingBuilt(mRconId, mMasterBuildFile.mPkgId, mMasterBuildFile.mPvId);
|
| 569 |
|
570 |
|
| 570 |
// Save the buildfile
|
571 |
// Save the buildfile
|
| 571 |
mLogger.fatal("Save buildfile");
|
572 |
mLogger.error("Save buildfile");
|
| 572 |
mPhase.setPhase("Save buildfile");
|
573 |
mPhase.setPhase("Save buildfile");
|
| 573 |
saveBuildFile(mMasterBuildFile.content);
|
574 |
saveBuildFile(mMasterBuildFile.content);
|
| 574 |
|
575 |
|
| 575 |
// Quick Test to validate the provided Version Control tag/label
|
576 |
// Quick Test to validate the provided Version Control tag/label
|
| 576 |
mPhase.setPhase("Validate Version Tag");
|
577 |
mPhase.setPhase("Validate Version Tag");
|
| Line 586... |
Line 587... |
| 586 |
mPhase.setPhase("Notify slaves of work", 10);
|
587 |
mPhase.setPhase("Notify slaves of work", 10);
|
| 587 |
if ( mMasterBuildFile.state != BuildFileState.NonGeneric)
|
588 |
if ( mMasterBuildFile.state != BuildFileState.NonGeneric)
|
| 588 |
{
|
589 |
{
|
| 589 |
// publish a dummy build file for either generic or dummy cases
|
590 |
// publish a dummy build file for either generic or dummy cases
|
| 590 |
// this results in the slave not running ant
|
591 |
// this results in the slave not running ant
|
| 591 |
mLogger.fatal("run calling publishBuildFile on dummy");
|
592 |
mLogger.error("run calling publishBuildFile on dummy");
|
| 592 |
mMasterBuildFile.content = mDummyBuildFileContent;
|
593 |
mMasterBuildFile.content = mDummyBuildFileContent;
|
| 593 |
}
|
594 |
}
|
| 594 |
else
|
595 |
else
|
| 595 |
{
|
596 |
{
|
| 596 |
// publish the build file
|
597 |
// publish the build file
|
| 597 |
mLogger.fatal("run calling publishBuildFile");
|
598 |
mLogger.error("run calling publishBuildFile");
|
| 598 |
}
|
599 |
}
|
| 599 |
mReleaseManager.publishBuildFile(mRtagId, mMasterBuildFile);
|
600 |
mReleaseManager.publishBuildFile(mRtagId, mMasterBuildFile);
|
| 600 |
|
601 |
|
| 601 |
|
602 |
|
| 602 |
if ( mUnitTest.compareTo("unit test generate build files") == 0 )
|
603 |
if ( mUnitTest.compareTo("unit test generate build files") == 0 )
|
| Line 609... |
Line 610... |
| 609 |
//---------------------------------------------------------------
|
610 |
//---------------------------------------------------------------
|
| 610 |
// Build the package
|
611 |
// Build the package
|
| 611 |
// Setup the workspace
|
612 |
// Setup the workspace
|
| 612 |
// Build the package - deliver change to product baseline
|
613 |
// Build the package - deliver change to product baseline
|
| 613 |
//
|
614 |
//
|
| 614 |
mLogger.fatal("Build Package " + mReporting.packageName + "_" + mReporting.packageVersion);
|
615 |
mLogger.error("Build Package " + mReporting.packageName + "_" + mReporting.packageVersion);
|
| 615 |
|
616 |
|
| 616 |
mLogger.info("run calling setViewUp");
|
617 |
mLogger.info("run calling setViewUp");
|
| 617 |
mPhase.setPhase("Setup View for build");
|
618 |
mPhase.setPhase("Setup View for build");
|
| 618 |
deliverChange("AbtSetUp", true, false);
|
619 |
deliverChange("AbtSetUp", true, false);
|
| 619 |
|
620 |
|
| Line 636... |
Line 637... |
| 636 |
//
|
637 |
//
|
| 637 |
catch( SQLException e )
|
638 |
catch( SQLException e )
|
| 638 |
{
|
639 |
{
|
| 639 |
// Oracle connection issues
|
640 |
// Oracle connection issues
|
| 640 |
// Request a prolonged sleep at the start of the build loop
|
641 |
// Request a prolonged sleep at the start of the build loop
|
| 641 |
mLogger.fatal("run oracle connection issues");
|
642 |
mLogger.error("run oracle connection issues");
|
| 642 |
mException = true;
|
643 |
mException = true;
|
| 643 |
}
|
644 |
}
|
| 644 |
catch( ExitException e )
|
645 |
catch( ExitException e )
|
| 645 |
{
|
646 |
{
|
| 646 |
mLogger.warn("run ExitException");
|
647 |
mLogger.warn("run ExitException");
|
| Line 655... |
Line 656... |
| 655 |
// BuildSystem exception - a (possibly) correctable error
|
656 |
// BuildSystem exception - a (possibly) correctable error
|
| 656 |
// Flag as recoverable
|
657 |
// Flag as recoverable
|
| 657 |
// - Can't create XML build file
|
658 |
// - Can't create XML build file
|
| 658 |
// -
|
659 |
// -
|
| 659 |
//
|
660 |
//
|
| 660 |
mLogger.fatal("run BuildSystemException");
|
661 |
mLogger.error("run BuildSystemException");
|
| 661 |
mPhase.setPhase("BuildSystemException indefinitePause");
|
662 |
mPhase.setPhase("BuildSystemException indefinitePause");
|
| 662 |
notifyIndefinitePause(e.getMessage());
|
663 |
notifyIndefinitePause(e.getMessage());
|
| 663 |
mReleaseManager.indefinitePause(false);
|
664 |
mReleaseManager.indefinitePause(false);
|
| 664 |
mException = true;
|
665 |
mException = true;
|
| 665 |
mRecoverable = true;
|
666 |
mRecoverable = true;
|
| Line 668... |
Line 669... |
| 668 |
catch( BuildToolException e)
|
669 |
catch( BuildToolException e)
|
| 669 |
{
|
670 |
{
|
| 670 |
// Buildtool exception - an uncorrectable error
|
671 |
// Buildtool exception - an uncorrectable error
|
| 671 |
// - Can't parse XML build file
|
672 |
// - Can't parse XML build file
|
| 672 |
//
|
673 |
//
|
| 673 |
mLogger.fatal("run BuildToolException");
|
674 |
mLogger.error("run BuildToolException");
|
| 674 |
mPhase.setPhase("BuildToolException indefinitePause");
|
675 |
mPhase.setPhase("BuildToolException indefinitePause");
|
| 675 |
notifyIndefinitePause(e.getMessage());
|
676 |
notifyIndefinitePause(e.getMessage());
|
| 676 |
mReleaseManager.indefinitePause(false);
|
677 |
mReleaseManager.indefinitePause(false);
|
| 677 |
mException = true;
|
678 |
mException = true;
|
| 678 |
}
|
679 |
}
|
| Line 746... |
Line 747... |
| 746 |
mLogger.info(message);
|
747 |
mLogger.info(message);
|
| 747 |
}
|
748 |
}
|
| 748 |
|
749 |
|
| 749 |
@Override
|
750 |
@Override
|
| 750 |
public void fatal(String message) {
|
751 |
public void fatal(String message) {
|
| 751 |
mLogger.fatal(message);
|
752 |
mLogger.error(message);
|
| 752 |
}
|
753 |
}
|
| 753 |
|
754 |
|
| 754 |
@Override
|
755 |
@Override
|
| 755 |
public void info(String message) {
|
756 |
public void info(String message) {
|
| 756 |
mLogger.info(message);
|
757 |
mLogger.info(message);
|
| Line 766... |
Line 767... |
| 766 |
cmd.add("-DeleteVersion");
|
767 |
cmd.add("-DeleteVersion");
|
| 767 |
cmd.add(!ReleaseManager.getUseMutex(), "-testArchive");
|
768 |
cmd.add(!ReleaseManager.getUseMutex(), "-testArchive");
|
| 768 |
cmd.add("'-pname=" + mReporting.packageName + "'");
|
769 |
cmd.add("'-pname=" + mReporting.packageName + "'");
|
| 769 |
cmd.add("'-pversion=" + mReporting.packageVersion + "'");
|
770 |
cmd.add("'-pversion=" + mReporting.packageVersion + "'");
|
| 770 |
|
771 |
|
| 771 |
mLogger.fatal("run remote command to delete " + mReporting.packageName +", "+ mReporting.packageVersion);
|
772 |
mLogger.error("run remote command to delete " + mReporting.packageName +", "+ mReporting.packageVersion);
|
| 772 |
int rv = mRemoteExecution.execute(cmd.toString());
|
773 |
int rv = mRemoteExecution.execute(cmd.toString());
|
| 773 |
mLogger.fatal("run remote command to delete. Returned " + rv);
|
774 |
mLogger.error("run remote command to delete. Returned " + rv);
|
| 774 |
|
775 |
|
| 775 |
// Belt and Braces
|
776 |
// Belt and Braces
|
| 776 |
// Ensure that the package-version has been deleted,
|
777 |
// Ensure that the package-version has been deleted,
|
| 777 |
// and if not then try to delete it the slow way.
|
778 |
// and if not then try to delete it the slow way.
|
| 778 |
//
|
779 |
//
|
| Line 784... |
Line 785... |
| 784 |
|
785 |
|
| 785 |
if ( dpkgArchiveEntryFile.exists() )
|
786 |
if ( dpkgArchiveEntryFile.exists() )
|
| 786 |
{
|
787 |
{
|
| 787 |
if ( dpkgArchiveEntryFile.isDirectory() )
|
788 |
if ( dpkgArchiveEntryFile.isDirectory() )
|
| 788 |
{
|
789 |
{
|
| 789 |
mLogger.fatal("run calling deleteDirectory on " + dpkgArchiveEntryFile);
|
790 |
mLogger.error("run calling deleteDirectory on " + dpkgArchiveEntryFile);
|
| 790 |
deleteDirectory(dpkgArchiveEntryFile);
|
791 |
deleteDirectory(dpkgArchiveEntryFile);
|
| 791 |
}
|
792 |
}
|
| 792 |
}
|
793 |
}
|
| 793 |
}
|
794 |
}
|
| 794 |
|
795 |
|