Esempio n. 1
0
        public static (string dacPacFolder, string dacPacFile) GetDacPacPaths()
        {
            var dacPacFile = ConsoleAppArgsParser.GetParamValue("DacPacFile", true);

            if (!File.Exists(dacPacFile))
            {
                throw new FileNotFoundException($"The DacPac file is not found on the path provided with \"DacPacFile\" console application argument: \"{dacPacFile}\".");
            }

            var dacPacFolder = Path.GetDirectoryName(dacPacFile);

            return(dacPacFolder, dacPacFile);
        }
Esempio n. 2
0
        static Logger()
        {
            LogFilePath = ConsoleAppArgsParser.GetParamValue("LogFile");

            if (!IsNullOrWhiteSpace(LogFilePath))
            {
                LogBuffer = new StringBuilder();
            }

            ExecutionMode = ModeDefiner.DefineMode();

            IsQuiet = ConsoleAppArgsParser.ParamExists("Quiet");
        }
Esempio n. 3
0
        public static string  GetBeforeDeploymentPath(string dacPacFolder = null)
        {
            var beforeDeploymentScript = ConsoleAppArgsParser.GetParamValue("BeforeDeploymentScript");

            if (!IsNullOrWhiteSpace(beforeDeploymentScript) && !IsNullOrWhiteSpace(dacPacFolder))
            {
                beforeDeploymentScript = Path.Combine(dacPacFolder, beforeDeploymentScript);

                if (!File.Exists(beforeDeploymentScript))
                {
                    throw new FileNotFoundException($"The BeforeDeploymentScript file is not found on the path provided with \"BeforeDeploymentScript\" console application argument: \"{beforeDeploymentScript}\".");
                }
            }

            return(beforeDeploymentScript);
        }
Esempio n. 4
0
        public static (string publishProfileFolder, string publishProfileFile) GetPublishProfilePaths()
        {
            var publishProfileFolder = ConsoleAppArgsParser.GetParamValue("PublishProfileFolder");

            if (!IsNullOrWhiteSpace(publishProfileFolder))
            {
                if (!Directory.Exists(publishProfileFolder))
                {
                    throw new FileNotFoundException($"The Publish Profile Folder is not found on the path provided with \"PublishProfileFolder\" console application argument: \"{publishProfileFolder}\".");
                }

                if (ConsoleAppArgsParser.ParamExists("prepare"))
                {
                    return(publishProfileFolder, null);
                }
            }

            var publishProfileFile = ConsoleAppArgsParser.GetParamValue("PublishProfileFile");
            var buildConfiguration = ConsoleAppArgsParser.GetParamValue("BuildConfiguration");

            var chosenPublishProfileFile = PublishProfileFileSelector.GetPublishProfileFile(publishProfileFolder, publishProfileFile, Environment.MachineName, buildConfiguration);

            return(publishProfileFolder, chosenPublishProfileFile);
        }
Esempio n. 5
0
        public static void LogConsoleArguments()
        {
            var messageSb = new StringBuilder();

            messageSb.AppendLine("Console arguments passed:");
            messageSb.AppendLine(DividerLine);

            var nameAndGapLength = "BeforeDeploymentScript".Length + 2;

            AppendValueLine(messageSb, "DacPacFile", ConsoleAppArgsParser.GetParamValue("DacPacFile"), nameAndGapLength);
            AppendValueLine(messageSb, "PublishProfileFolder", ConsoleAppArgsParser.GetParamValue("PublishProfileFolder"), nameAndGapLength);
            AppendValueLine(messageSb, "PublishProfileFile", ConsoleAppArgsParser.GetParamValue("PublishProfileFile"), nameAndGapLength);
            AppendValueLine(messageSb, "BuildConfiguration", ConsoleAppArgsParser.GetParamValue("BuildConfiguration"), nameAndGapLength);
            AppendValueLine(messageSb, "BeforeDeploymentScript", ConsoleAppArgsParser.GetParamValue("BeforeDeploymentScript"), nameAndGapLength);
            AppendValueLine(messageSb, "CompilationFolder", ConsoleAppArgsParser.GetParamValue("CompilationFolder"), nameAndGapLength);
            AppendValueLine(messageSb, "Compile", ConsoleAppArgsParser.ParamExists("Compile") ? "True" : "False", nameAndGapLength);
            AppendValueLine(messageSb, "Deploy", ConsoleAppArgsParser.ParamExists("Deploy") ? "True" : "False", nameAndGapLength);
            AppendValueLine(messageSb, "Quiet", ConsoleAppArgsParser.ParamExists("Quiet") ? "True" : "False", nameAndGapLength);
            AppendValueLine(messageSb, "LogFile", ConsoleAppArgsParser.GetParamValue("LogFile"), nameAndGapLength);

            messageSb.AppendLine(".");

            Logger.Append(messageSb.ToString());
        }
Esempio n. 6
0
 public static string GetCompilationFolderPath()
 {
     return(ConsoleAppArgsParser.GetParamValue("CompilationFolder", true));
 }