Beispiel #1
0
        static Locations()
        {
            ApplicationDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ??
                                   Path.GetFullPath(".");

            switch (Platforms.GetPlatform())
            {
            case Platform.Linux:
                DefaultContentDirectory       = "/usr/share/eventstore";
                DefaultConfigurationDirectory = "/etc/eventstore";
                DefaultDataDirectory          = "/var/lib/eventstore";
                DefaultLogDirectory           = "/var/log/eventstore";
                DefaultTestClientLogDirectory = Path.Combine(ApplicationDirectory, "testclientlog");
                break;

            default:
                DefaultContentDirectory       = ApplicationDirectory;
                DefaultConfigurationDirectory = ApplicationDirectory;
                DefaultDataDirectory          = Path.Combine(ApplicationDirectory, "data");
                DefaultLogDirectory           = Path.Combine(ApplicationDirectory, "logs");
                DefaultTestClientLogDirectory = Path.Combine(ApplicationDirectory, "testclientlog");
                break;
            }

            WebContentDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "clusternode-web"),
                Path.Combine(DefaultContentDirectory, "clusternode-web")
                );
            ProjectionsDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "projections"),
                Path.Combine(DefaultContentDirectory, "projections")
                );
            PreludeDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "Prelude"),
                Path.Combine(DefaultContentDirectory, "Prelude")
                );
        }
Beispiel #2
0
        static Locations()
        {
            ApplicationDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ??
                                   Path.GetFullPath(".");

            PluginsDirectory             = Path.Combine(ApplicationDirectory, "plugins");
            FallbackDefaultDataDirectory = Path.Combine(ApplicationDirectory, "data");

            switch (Platforms.GetPlatform())
            {
            case Platform.Linux:
                DefaultContentDirectory       = "/usr/share/eventstore";
                DefaultConfigurationDirectory = "/etc/eventstore";
                DefaultDataDirectory          = "/var/lib/eventstore";
                DefaultLogDirectory           = "/var/log/eventstore";
                DefaultTestClientLogDirectory = Path.Combine(ApplicationDirectory, "testclientlog");
                if (!Directory.Exists(PluginsDirectory))
                {
                    PluginsDirectory = Path.Combine(DefaultContentDirectory, "plugins");
                }
                break;

            case Platform.Mac:
                DefaultContentDirectory       = "/usr/local/share/eventstore";
                DefaultConfigurationDirectory = "/etc/eventstore";
                DefaultDataDirectory          = "/var/lib/eventstore";
                DefaultLogDirectory           = "/var/log/eventstore";
                DefaultTestClientLogDirectory = Path.Combine(ApplicationDirectory, "testclientlog");
                if (!Directory.Exists(PluginsDirectory))
                {
                    PluginsDirectory = Path.Combine(DefaultContentDirectory, "plugins");
                }
                break;

            default:
                DefaultContentDirectory       = ApplicationDirectory;
                DefaultConfigurationDirectory = ApplicationDirectory;
                DefaultDataDirectory          = Path.Combine(ApplicationDirectory, "data");
                DefaultLogDirectory           = Path.Combine(ApplicationDirectory, "logs");
                DefaultTestClientLogDirectory = Path.Combine(ApplicationDirectory, "testclientlog");
                break;
            }

            DevCertificateDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "dev-ca"),
                Path.Combine(DefaultContentDirectory, "dev-ca")
                );

            WebContentDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "clusternode-web"),
                Path.Combine(DefaultContentDirectory, "clusternode-web")
                );
            ProjectionsDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "projections"),
                Path.Combine(DefaultContentDirectory, "projections")
                );
            PreludeDirectory = GetPrecededLocation(
                Path.Combine(ApplicationDirectory, "Prelude"),
                Path.Combine(DefaultContentDirectory, "Prelude")
                );
            PreludeResourcesPath = "EventStore.Projections.Core.Prelude";
        }