Created dotnet2.0 Builder Image and Added /v2/specialized Endpoint to dotnet2.0 Envrionment (#1001)
This commit is contained in:
committed by
Ta-Ching Chen
parent
56fa8fe766
commit
4632269314
@@ -0,0 +1,55 @@
|
||||
using Builder.Utility;
|
||||
using NugetWorker;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Builder.Engine;
|
||||
|
||||
namespace Builder
|
||||
{
|
||||
class Builder
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Builder Task Begins!");
|
||||
//create log file name for this session
|
||||
var logFileName = $"{DateTime.Now.ToString("yyyy_MM_dd")}_{Guid.NewGuid().ToString()}.log";
|
||||
Console.WriteLine($"going to create logger!!");
|
||||
|
||||
try
|
||||
{
|
||||
string _logdirectory = BuilderHelper.Instance.builderSettings.BuildLogDirectory;
|
||||
BuilderHelper.Instance._logFileName = Path.Combine(_logdirectory, logFileName);
|
||||
BuilderHelper.Instance.logger = new Utility.Logger(
|
||||
BuilderHelper.Instance._logFileName);
|
||||
|
||||
//set the same for nuget engine dll
|
||||
NugetHelper.Instance.logger = new NugetWorker.Logger(BuilderHelper.Instance._logFileName);
|
||||
|
||||
Console.WriteLine($"detailed logs for this build will be at : {Path.Combine(_logdirectory, logFileName)}!!");
|
||||
|
||||
|
||||
BuilderEngine builderEngine = new BuilderEngine();
|
||||
builderEngine.BuildPackage().Wait();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string detailedException = string.Empty;
|
||||
try
|
||||
{
|
||||
detailedException= BuilderHelper.Instance.DeepException(ex);
|
||||
Console.WriteLine($"Exception During Build : {Environment.NewLine} {ex.Message} | {ex.StackTrace} | {Environment.NewLine} {detailedException}");
|
||||
}
|
||||
catch(Exception childEx)
|
||||
{
|
||||
//do nothing , just log orignal exception
|
||||
Console.WriteLine($"{Environment.NewLine} Exception During Build :{ex.Message} |{Environment.NewLine} {ex.StackTrace} {Environment.NewLine} ");
|
||||
}
|
||||
|
||||
//now throw back exception so that build gets failed via builder
|
||||
throw;
|
||||
}
|
||||
|
||||
Console.WriteLine("Builder Task Ends!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user