예제 #1
0
        private void Run()
        {
            int    version = Options.TargetVersion ?? -1;
            string mode    = (Options.Mode ?? "manual").ToLower();

            if (mode == "script")
            {
                RunScript(version);
                return;
            }
            if (mode == "auto")
            {
                var runner = new Runner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
                runner.MigrationGroup = Options.MigrationGroup;
                runner.Run(version);
                return;
            }
            if (mode == "seed")
            {
                if (String.IsNullOrEmpty(Options.SeedName))
                {
                    Exit("Please, set the seed name");
                    return;
                }
                var seedRunner = new SeedRunner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
                seedRunner.Run(Options.SeedName, Options.SeedArgs, Options.MigrationGroup);
                return;
            }
            var crunner = new ConsoleRunner(SharpFactory.Default.ConnectionString, SharpFactory.Default.DataProviderName);

            crunner.AssemblyWithMigrations = GetAssemblyWithMigrations();
            crunner.MigrationGroup         = Options.MigrationGroup;
            crunner.Start();
        }
예제 #2
0
        static void Main(string[] args)
        {
            var connectionString = ConfigurationManager.ConnectionStrings["System.Data.SqlClient"].ConnectionString;
            var factory          = new SharpFactory(SqlClientFactory.Instance, connectionString);
            var consoleRunner    = new ConsoleRunner(factory.CreateDataClient(), Assembly.GetExecutingAssembly(), "Chinnok");

            consoleRunner.Start();
        }
예제 #3
0
        private static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            var connString = ConfigurationManager.ConnectionStrings["Oracle.ManagedDataAccess.Client"].ConnectionString;
            var runner     = new ConsoleRunner(connString, DataProviderNames.OracleManaged);

            runner.Start();
        }
예제 #4
0
        public void Start()
        {
            if (Runner != null)
            {
                return;
            }

            ConsoleRunner tmp = new ConsoleRunner(Settings, Name);

            tmp.Start();
            Runner = tmp;
        }
예제 #5
0
            public override void Execute(PipelineContext ctx, JObject obj)
            {
                String actualCmd = Invariant.Format(cmd, fillParams(ctx, obj));

                settings.Arguments  = Invariant.Format(cmd, fillParams(ctx, obj));
                settings.WorkingDir = WorkingDir;

                using (ConsoleRunner runner = new ConsoleRunner(settings, null))
                {
                    runner.Start();
                    if (!runner.WaitForExit(10000))
                    {
                        runner.Stop_CtrlC();
                    }
                    if (runner.ExitCode != 0)
                    {
                        issueError(ctx, String.Format("cmd.exe {0}\nEnded with rc={1}.", actualCmd, runner.ExitCode));
                    }
                }
            }
예제 #6
0
        public static void Main()
        {
            var bootstrapper = new TodoWriteBootstrap();

            ConsoleRunner.Start(bootstrapper);
        }
예제 #7
0
        static void Main(string[] args)
        {
            var bootstrap = new TodoReadBootstrap();

            ConsoleRunner.Start(bootstrap);
        }