public static void Containerize(string[] args, Action main) { if (InDockerContainer()) { main(); return; } Config config = new Config(); RuntimeConfig runtimeConfig = null; TestConfig testConfig = null; var trace = new StackTrace(); foreach (object attribute in trace.GetFrame(1).GetMethod().GetCustomAttributes(true)) { if (attribute is Config) { config = (Config)attribute; } if (attribute is RuntimeConfig) { runtimeConfig = (RuntimeConfig)attribute; } if (attribute is TestConfig) { testConfig = (TestConfig)attribute; } } var mp = new Driver(config, runtimeConfig, testConfig); mp.Build(args); }
public Driver(Config config, RuntimeConfig runtimeConfig, TestConfig testConfig) { this.config = config; this.runtimeConfig = runtimeConfig; this.testConfig = testConfig; }