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(); }
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(); }
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(); }
public void Start() { if (Runner != null) { return; } ConsoleRunner tmp = new ConsoleRunner(Settings, Name); tmp.Start(); Runner = tmp; }
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)); } } }
public static void Main() { var bootstrapper = new TodoWriteBootstrap(); ConsoleRunner.Start(bootstrapper); }
static void Main(string[] args) { var bootstrap = new TodoReadBootstrap(); ConsoleRunner.Start(bootstrap); }