private IEnumerable<string> DeployRun(string action, ComponentRunContext runContext)
        {
            if (Directory.Exists(mTemplatesPath))
            {
                yield return string.Format("Templates {0} -> {1}", mTemplatesPath, mReleaseInfo.Branch.DeployPath);

                using (runContext.DepthScope())
                {
                    var synchronizer = new FileSynchronizer(mTemplatesPath, mReleaseInfo.Branch.DeployPath, TemplateFileRegex);
                    foreach (var log in synchronizer.Run(action, runContext))
                    {
                        yield return log;
                    }
                }
            }
        }
        private IEnumerable<string> MakeReleasePackageRun(string action, ComponentRunContext runContext)
        {
            if (Directory.Exists(mTemplatesPath))
            {
                var packageDir = runContext.Config.GetPackageDirectory(mReleaseInfo, "Reports+Templates");
                yield return string.Format("Templates {0} -> {1}", mTemplatesPath, packageDir);

                using (runContext.DepthScope())
                {
                    var synchronizer = new FileSynchronizer(mTemplatesPath, packageDir, TemplateFileRegex);
                    foreach (var log in synchronizer.Run(action, runContext))
                    {
                        yield return log;
                    }
                }
            }
        }
Esempio n. 3
0
        private IEnumerable<string> MakeReleasePackageRun(string action, ComponentRunContext runContext)
        {
            if (Directory.Exists(mScriptsPath))
            {
                var packageDir = runContext.Config.GetPackageDirectory(mReleaseInfo, "Scripts");
                yield return string.Format("Scripts {0} -> {1}", mScriptsPath, packageDir);

                using (runContext.DepthScope())
                {
                    var synchronizer = new FileSynchronizer(mScriptsPath, packageDir, GetScriptsFilterByEnvironment(runContext.Environment));
                    foreach (var log in synchronizer.Run(action, runContext))
                    {
                        yield return log;
                    }
                }

                var scriptName = mReleaseInfo.Name + @".sql";
                yield return string.Format("Generating script {0}", scriptName);

                var sb = new StringBuilder();
                GenerateScript(runContext.Environment, sb, false, packageDir).RunToEnd();

                if (!runContext.DryRun)
                {
                    File.WriteAllText(runContext.Config.GetPackageDirectory(mReleaseInfo.Branch, scriptName), sb.ToString());
                }
            }
        }