Esempio n. 1
0
        public void Start()
        {
#if DEBUG
            string environmentName = "awesome!";
#else
            string environmentName = EC2Environment.GetEnvironmentName();
#endif
            MachineConfig machineConfig = new MachineConfig(environmentName);
            this.restartService = new RestartHubClient(machineConfig);

            string configFile = ConfigurationManager.AppSettings["File"];
            ConfigOverrideManager configOverrideManager = new ConfigOverrideManager(configFile);

            this.configUpdater   = new ConfigUpdater(machineConfig, configOverrideManager);
            this.configHubClient = new ConfigHubClient(machineConfig, this.configUpdater);
        }
Esempio n. 2
0
        public static string GetEnvironmentName()
        {
            EC2Environment.Log.Debug("Starting GetEnvironmentName");

            string instanceName = EC2Environment.GetInstanceId();

            EC2Environment.Log.Debug("InstanceName " + instanceName);

            var region = EC2Environment.GetRegion();

            EC2Environment.Log.Debug("region DisplayName: " + region.DisplayName);
            EC2Environment.Log.Debug("region SystemName: " + region.SystemName);

            var instance = EC2Environment.GetInstance(instanceName, region);

            EC2Environment.Log.Debug("InstanceId: " + instance.InstanceId);

            var enviromentName = EC2Environment.GetBeanstalkEnvironmentName(instance);

            return(enviromentName);
        }