Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
update build signe to be a bit more soft on errors from service when …
Browse files Browse the repository at this point in the history
…waiting
  • Loading branch information
NETMF Build Service committed Oct 20, 2015
1 parent 03a891d commit b7769ee
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Framework/Tools/BuildTasksInternal/BuildSigner/BuildSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ Release Technical Solutions Centre
*/
#endregion

//"Codesign" represents the server - static variable do not change
//9556 represents the port - constant value do not change
const string RelayServer = "codesign.gtm.microsoft.com";
const int RelayPort = 9556;

private static bool SubmitJob(string unsignedDirectory, string signedDirectory)
{
// use env var so it is dynamic for the machine running this build to help prevent
Expand All @@ -170,9 +175,7 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory)
try
{
//Initialize the Codesign.Submitter object
//"Codesign" represents the server - static variable do not change
//9556 represents the port - constant value do not change
job = CODESIGN.Submitter.Job.Initialize("codesign.gtm.microsoft.com", 9556, true);
job = CODESIGN.Submitter.Job.Initialize(RelayServer, RelayPort, true);

// Sets the Partial return flag option.
// False - If any files fail signing you will not get any files back.
Expand Down Expand Up @@ -253,11 +256,14 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory)
JobWatcher jw = new JobWatcher();
if (!fakeSign)
{
// These calls optionally wait till the job is finished
// WARNING: this completely block execution for the specified timespan
int Milliseconds = -1; // -1: wait forever
jw.Watch(job, Milliseconds);
//jw.Watch(job); // you can also call the Watch method this way and wait forever
try
{
jw.Watch(job.JobNumber, RelayServer, RelayPort, true);
}
catch(Exception ex )
{ // I hate general exceptions but the complete lack of documentation on the submitter leaves little choice and we need to ship...
m_CallingTask.Log.LogWarning("Exception waiting for job - assuming job completed, subsequent steps may fail.\nExeption: {0}", ex);
}
}

// Now we're done, so display any errors or warnings (in case we are in non-event mode)
Expand Down

0 comments on commit b7769ee

Please # to comment.