Ejemplo n.º 1
0
        private static string GetInstallerDistributionPath(CommandLineParameters cliParams)
        {
            if (!string.IsNullOrEmpty(cliParams.InstallerDistributionPath))
            {
                return(cliParams.InstallerDistributionPath);
            }

            return(ConfigurationManager.AppSettings[ConfigurationKeys.installerDistributionPath]);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            LoggerFactory = Log4NetNotifierFactory.FromConfigurationFileInApplicationFolder();
            try
            {
                var cliParams = CommandLineParameters.Parse(args);

                var argsDescription = string.Join("; ", args);
                Logger.Info($"BEGIN BUILD {argsDescription}");

                string installerDefinitionServerPath         = ConfigurationManager.AppSettings[ConfigurationKeys.installerDefinitionServerPath];
                string ggpApprovalSystemSourceCodeServerPath = ConfigurationManager.AppSettings[ConfigurationKeys.ggpApprovalSystemSourceCodeServerPath];
                string installerDistributionPath             = GetInstallerDistributionPath(cliParams);



                var builder = new InstallerBuilder(GetServices());
                builder.Build(new BuildTaskInfo(cliParams.BranchName,
                                                cliParams.Environment,
                                                installerDefinitionServerPath),
                              ggpApprovalSystemSourceCodeServerPath,
                              installerDistributionPath);

                Logger.Info("BUILD SUCCESSFULL!");
            }
            catch (InvalidCommandLineArgumnentsException ex)
            {
                if (!string.IsNullOrEmpty(ex.Message))
                {
                    if (ex.InnerException != null)
                    {
                        Logger.Exception(ex);
                    }
                    else
                    {
                        Logger.Error(ex.Message);
                    }
                }

                Logger.Info(ex.UsageInfo);
                ExitWithError(ex);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex);
                Logger.Error("BUILD FAILED!");
                ExitWithError(ex);
            }
        }
Ejemplo n.º 3
0
        public static CommandLineParameters Parse(string[] args)
        {
            if (args.Length == 0)
            {
                throw new InvalidCommandLineArgumnentsException(GetUsageInfo());
            }

            var parser = new CommandLineParametersParser(args, GetUsageInfo());

            var environment = parser.GetMandatoryParameterValue <DeployEnvironment>(ENVIRONMENT_ARG);
            var branchName  = parser.GetMandatoryParameterValue <string>(BRANCH_ARG);



            var result = new CommandLineParameters(environment, branchName);

            parser.GetOptionalParameterValue <string>(INSTALLER_DISTRIBUTION_PATH_ARG).Do(val => result.InstallerDistributionPath = val);

            return(result);
        }