static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("-------------------------------------------------------------------------------"); Console.WriteLine("\tTfsCreateServiceBuildDefinition"); Console.WriteLine(); //#if DEBUG // Nos paramos aquí y pedimos si queremos depurar (sólo en DEBUG) // Debugger.Launch(); //#endif // Try to parse options from command line var options = new Options(); if (Parser.Default.ParseArguments(args, options)) { try { CommonData = new CommonStructure(options); Console.WriteLine("\tTeam Project Collection: {0}", options.TeamCollection); Console.WriteLine("\tTeam Project: {0}", options.TeamProject); Console.WriteLine("\tShared TFS location: {0}", options.SharedTfsLocation); Console.WriteLine("\tTemplates Team Project: {0}", options.TemplatesTeamProject); Console.WriteLine("\tStandard Template: {0}", CommonData.StandardTemplatePath); Console.WriteLine("\tServices Template: {0}", CommonData.ServicesTemplatePath); Console.WriteLine("\tNo-compile Template: {0}", CommonData.NoCompileFullTemplatePath); Console.WriteLine("\tSave build definitions: {0}", options.Save); Console.WriteLine(); Console.WriteLine("\tBuild Definition name: {0}", options.BuildName); Console.WriteLine("\tDescription: {0}", options.Description); Console.WriteLine("\tSolution: {0}", options.SolutionName); Console.WriteLine("\tPath: {0}", options.TfsProjectPath); Console.WriteLine("\tBuild Controller: {0}", options.BuildController); Console.WriteLine(); Console.WriteLine("\tServices: {0}", options.ServiceToDeploy); Console.WriteLine("\tServer hostname: {0}", options.ServiceHost); Console.WriteLine("\tRemote location into server: {0}", options.ServiceLocation); Console.WriteLine("\tLocal path into server: {0}", options.ServiceLocalPath); Console.WriteLine("\tUser name: {0}", options.ServiceUser); Console.WriteLine("\tPassword: {0}", options.ServicePassword); Console.WriteLine("-------------------------------------------------------------------------------"); var buildDef = CreateDefinition(options, Constants.ReleaseFolder); if (options.Save) { buildDef.Save(); Console.WriteLine("The build definition was created"); } else { Console.WriteLine( "The simulation was OK. Use --save to actually create the build definition."); } } catch (Exception ex) { Console.WriteLine("\nAn error occured:\n{0}\n", ex.Message); } } else { Console.WriteLine("Couldn't read options!"); Console.WriteLine(); Console.WriteLine("Example: TfsCreateServiceBuildDefinition.exe --project Hoteles --name Hot.MyService.Service --description \"Super build\" --tfspath $/Hoteles/Release/Services/MyService\n --solution Toolfactory.Hotels.MyService.sln --controller logpmcompile02p\n --service MyService;Toolfactory.Hotels.MyService.exe --servicelocation EjecutablesNET\\Hoteles --servicelocalpath D:\\EjecutablesNET\\Hoteles\n --servicehost logviprc02v.logitravelprod.local --serviceuser logviprc02v\\administrator --servicepassword zlgaYrnnu2GM2N/2v96Jdw==\n --test false"); } }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("-------------------------------------------------------------------------------"); Console.WriteLine("\tTfsCreateWebBuildDefinitions"); Console.WriteLine(); //#if DEBUG // Nos paramos aquí y pedimos si queremos depurar (sólo en DEBUG) // Debugger.Launch(); //#endif // Try to parse options from command line var options = new Options(); if (Parser.Default.ParseArguments(args, options)) { try { CommonData = new CommonStructure(options); Console.WriteLine("\tTeam Project Collection: {0}", options.TeamCollection); Console.WriteLine("\tTeam Project: {0}", options.TeamProject); Console.WriteLine("\tShared TFS location: {0}", options.SharedTfsLocation); Console.WriteLine("\tTemplates Team Project: {0}", options.TemplatesTeamProject); Console.WriteLine("\tStandard Template: {0}", CommonData.StandardTemplatePath); Console.WriteLine("\tServices Template: {0}", CommonData.ServicesTemplatePath); Console.WriteLine("\tNo-compile Template: {0}", CommonData.NoCompileFullTemplatePath); Console.WriteLine("\tSave build definitions: {0}", options.Save); Console.WriteLine(); Console.WriteLine("\tBuild Definition name: {0}", options.BuildName); Console.WriteLine("\tDescription: {0}", options.Description); Console.WriteLine("\tSolution: {0}", options.SolutionName); Console.WriteLine("\tPath: {0}", options.TfsProjectPath); Console.WriteLine("\tBuild Controller: {0}", options.BuildController); Console.WriteLine(); Console.WriteLine("\tBinaries pattern: {0}", options.BinariesPattern); Console.WriteLine("\tIIS Server Pre: {0}", options.IisServerPre); Console.WriteLine("\tIIS Sitename Pre: {0}", options.IisSiteNamePre); Console.WriteLine("\tIIS Server Pro: {0}", options.IisSiteNamePro); Console.WriteLine("\tDeployment packages UNC: {0}", CommonData.DeploymentPackagesLocation); Console.WriteLine("\tJS Parsing Pre: {0}", options.JsParsingPre); Console.WriteLine("\tJS Parsing Pro: {0}", options.JsParsingPro); Console.WriteLine("-------------------------------------------------------------------------------"); var buildDefMain = CreateDefinition(options, Constants.MainFolder); var buildDefRelease = CreateDefinition(options, Constants.ReleaseFolder); if (options.Save) { buildDefMain.Save(); Console.WriteLine("Main build definition was created"); buildDefRelease.Save(); Console.WriteLine("Release build definition was created"); } else { Console.WriteLine( "The simulation was OK. Use --save to actually create the build definition."); } } catch (Exception ex) { Console.WriteLine("\nAn error occured:\n{0}\n", ex.Message); } } else { Console.WriteLine("Couldn't read options!"); Console.WriteLine(); Console.WriteLine("Example: TfsCreateWebBuildDefinition.exe --project Hoteles --name Hot.Web --description \"Super build\" --tfspath $/Hoteles/Release/Web/Hoteles.Web\n --solution Toolfactory.Hotels.Web.sln --controller logpmcompile01p\n --assemblies \"Toolfactory.Hotels.BaseTypes.dll;Toolfactory.Hotels.Dao.dll\" --issserver logvidevweb01v.logitravelprod.local --iissitenamepre hotels.dev.logitravel.com --iissitenamepro www.logitravel.com/hoteles\n --test false"); } }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("-------------------------------------------------------------------------------"); Console.WriteLine("\tTfsUpdateBuildDefinition"); Console.WriteLine(); // Try to parse options from command line var options = new Options(); if (Parser.Default.ParseArguments(args, options)) { try { CommonData = new CommonStructure(options); Console.WriteLine("\tTeam Project Collection: {0}", options.TeamCollection); Console.WriteLine("\tTeam Project: {0}", options.TeamProject); Console.WriteLine("\tShared TFS location: {0}", options.SharedTfsLocation); Console.WriteLine("\tTemplates Team Project: {0}", options.TemplatesTeamProject); Console.WriteLine("\tStandard Template: {0}", CommonData.StandardTemplatePath); Console.WriteLine("\tServices Template: {0}", CommonData.ServicesTemplatePath); Console.WriteLine("\tNo-compile Template: {0}", CommonData.NoCompileFullTemplatePath); Console.WriteLine("\tParallel processing: {0}", options.Parallel); Console.WriteLine("\tData file: {0}", options.DataFile); Console.WriteLine("\tSkip Params: {0}", options.SkipParameters); Console.WriteLine("\tSave build definitions: {0}", options.Save); Console.WriteLine("\tDeployment packages UNC: {0}", CommonData.DeploymentPackagesLocation); _externalConfiguration = ReadDataFile(options.DataFile); if (_externalConfiguration.Any()) { Console.WriteLine("\t{0} build definition configurations read from file", _externalConfiguration.Count); } Console.WriteLine("-------------------------------------------------------------------------------"); var buildDefinitionsToSave = ChangeDefinitions(options); if (buildDefinitionsToSave.Count == 0) Console.WriteLine("All build definitions are up to date!"); else { if (options.Save) { CommonData.BuildServer.SaveBuildDefinitions(buildDefinitionsToSave.ToArray()); Console.WriteLine("Updating {0} build definitions...", buildDefinitionsToSave.Count); } else { Console.WriteLine("The simulation was OK. {0} build definition(s) to update. Use --save to actually update the build definition.", buildDefinitionsToSave.Count); } } } catch (Exception ex) { Console.WriteLine("\nAn error occured:\n{0}\n", ex.Message); } } else { Console.WriteLine("Couldn't read options!"); Console.WriteLine(); } }