private async Task <WorkflowResult> Run(string project, string job) { var binDir = Path.GetDirectoryName(new FileInfo(typeof(UnitTest1).Assembly.Location).FullName); var cfgFile = Path.Combine(binDir, "Configuration", "config.yaml"); var cfg = DotRunConfig.FromFile(cfgFile); return(await cfg.Projects[project].Workflows[job].Run()); }
static async Task Main(string[] args) { System.Console.WriteLine("Init DotRun"); string cfgFile = null; var idx = Array.IndexOf(args, "--config-file"); if (idx > -1 && idx + 1 < args.Length) { cfgFile = args[idx + 1]; } if (cfgFile == null) { System.Console.WriteLine("Please specify --config-file"); return; } var cfg = DotRunConfig.FromFile(cfgFile); string cfgProject = null; idx = Array.IndexOf(args, "--project"); if (idx > -1 && idx + 1 < args.Length) { cfgProject = args[idx + 1]; } string cfgWorkflow = null; idx = Array.IndexOf(args, "--workflow"); if (idx > -1 && idx + 1 < args.Length) { cfgWorkflow = args[idx + 1]; } var result = await cfg.Projects[cfgProject].Workflows[cfgWorkflow].Run(); System.Console.WriteLine(result.Failed ? "Failed" : "Done"); }