public void EnvironmentSetup(IVostokHostingEnvironmentBuilder builder)
		{
			var configurationProvider = new ConfigurationProvider(new ConfigurationProviderSettings());
			var configurationSource = GetConfigurationSource();
			configurationProvider.SetupSourceFor<UlearnConfiguration>(configurationSource);
			var ulearnConfiguration = configurationProvider.Get<UlearnConfiguration>();
			var environment = ulearnConfiguration.Environment ?? "dev";

			if (!ulearnConfiguration.DisableKonturServices)
				builder = builder.SetupForKontur();

			builder.SetupApplicationIdentity(identityBuilder => identityBuilder
					.SetProject("ulearn")
					.SetApplication(application)
					.SetEnvironment(environment)
					.SetInstance(Environment.MachineName.Replace(".", "_").ToLower()))
				.SetupConfiguration(configurationBuilder => configurationBuilder.AddSecretSource(configurationSource));
			if (ulearnConfiguration.Port != null)
				builder.SetPort(ulearnConfiguration.Port.Value);
			if (ulearnConfiguration.BaseUrl != null)
				builder.SetBaseUrlPath(ulearnConfiguration.BaseUrl);
			builder	
				.DisableServiceBeacon()
				.SetupHerculesSink(sinkBuilder => SetupHerculesSink(sinkBuilder, ulearnConfiguration))
				.SetupLog((logBuilder, context) => SetupLog(logBuilder, ulearnConfiguration))
				;

			if (ulearnConfiguration.ForceHttps ?? false)
				builder.SetHttpsScheme();
		}
Exemple #2
0
        private void SetupEnvironment(IVostokHostingEnvironmentBuilder builder, int port)
        {
            builder.SetupApplicationIdentity(
                s => s.SetProject("Project")
                .SetSubproject("SubProject")
                .SetEnvironment("Env")
                .SetApplication("App")
                .SetInstance("Instance"))
            .SetPort(port)
            .SetupLog(s => s.AddLog(Log));

            builder.DisableClusterConfig();
        }
Exemple #3
0
        private static void SetupEnvironment(IVostokHostingEnvironmentBuilder builder)
        {
            builder.SetupApplicationIdentity(
                id =>
            {
                id.SetProject("infra");
                id.SetApplication("vostok-test");
                id.SetEnvironment("dev");
                id.SetInstance("the only one");
            });

            builder.SetupLog(log => log.SetupConsoleLog());
        }
        private static void MultiHostApplicationBuilder(IVostokHostingEnvironmentBuilder builder)
        {
            builder.SetupApplicationIdentity(
                id =>
            {
                id.SetProject("good project");
                id.SetApplication("vostok-test");
                id.SetEnvironment("dev");
                id.SetInstance("the only one");
            });

            builder.SetupLog(log => log.SetupConsoleLog());

            builder.SetupShutdownTimeout(1.Milliseconds());
        }
Exemple #5
0
        private void SetupCommons(IVostokHostingEnvironmentBuilder builder)
        {
            builder.SetupApplicationIdentity(
                id =>
            {
                id.SetProject("Project");
                id.SetApplication("App");
                id.SetEnvironment("Environment");
                id.SetInstance("Instance");
            });

            builder.SetupShutdownToken(shutdown.Token);

            builder.SetupShutdownTimeout(30.Seconds() + ShutdownConstants.CutAmountForExternalTimeout);

            builder.SetupLog(log => log.SetupConsoleLog());
        }
Exemple #6
0
        private static void SetupEnvironment(IVostokHostingEnvironmentBuilder builder)
        {
            builder.SetupApplicationIdentity(
                id =>
            {
                id.SetProject("infra");
                id.SetApplication("vostok-test");
                id.SetEnvironment("dev");
                id.SetInstance("the only one");
            });

            builder.SetupLog(log => log.SetupConsoleLog());

            builder.SetupConfiguration(
                config =>
            {
                config.AddSource(new ObjectSource(new {}));
                config.AddSecretSource(new ObjectSource(new {}));
            });

            builder.SetupClusterConfigClient(config =>
                                             config.CustomizeSettings(setting => setting.EnableClusterSettings = false));
        }