Пример #1
0
        public static int Main(string[] args)
        {
            var connectionString = ConnectionStringFactory.GetConnectionString(args);
            var isDryRun         = args.Contains("dryRun");

            var preDeployResult = PerformUpgrade(connectionString, EnvironmentFilter.GetPreDeployFilter(args), isDryRun);

            if (!preDeployResult.Successful)
            {
                return(ResultReporter.ReportResult(preDeployResult));
            }
            ResultReporter.ReportResult(preDeployResult);

            var result = PerformUpgrade(connectionString, EnvironmentFilter.GetFilter(args), isDryRun);

            if (!result.Successful)
            {
                return(ResultReporter.ReportResult(result));
            }
            ResultReporter.ReportResult(result);

            var postDeployResult = PerformUpgrade(connectionString, EnvironmentFilter.GetPostDeployFilter(args), isDryRun);

            return(ResultReporter.ReportResult(postDeployResult));
        }
Пример #2
0
        public void PreDeployment_Script_is_included_when_parameters_match(bool expectedToRun, string scriptFile, params string[] args)
        {
            // Arrange
            var filter = EnvironmentFilter.GetPreDeployFilter(args);

            // Act
            var actual = filter.Invoke(scriptFile);

            // Assert
            actual.Should().Be(expectedToRun);
        }