Esempio n. 1
0
        private static void LoadAndVerifyConfig()
        {
            if (!File.Exists(@".\config.json"))
            {
                throw new ApplicationException("There is no config.json file. Run SqlCi.Console -i to get started.");
            }

            _configuration = JsonConvert.DeserializeObject <Configuration>(File.ReadAllText(@".\config.json"));
            _configuration.Verify();
        }
Esempio n. 2
0
        private void VerifyConfiguration(Configuration configuration, string environment)
        {
            // let our host know we are about to verify the config
            LogInfo("Verifying configuration ...");

            // no config means we can't proceed
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            // make sure that the host called Verify() on the environment before we try to do any work
            var environmentConfig = configuration.Verify(environment);

            // let our host know configuration has been verified
            LogSuccess("Configuration verification complete.");

            // store the config so other instance methods can reference it later on
            _configuration            = configuration;
            _environmentConfiguration = environmentConfig;
        }