Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sett1x aims to externalize the application configuration. Usually in .NET projects the configuration is done in app/web.config with transformations.

The problem arises when production configuration is needed which should not be part of the application repository because it is an OSS project for example. This is where Sett1x comes. You can configure the application using the following structure and store these files in a separate repository:

ReferenceConfiguration.json

{
    "name": "ReferenceConfiguration",
    "defaults": {
        "refSetting0": "refSetting0",
        "refSetting1": "refSetting1",
        "refSetting2": "refSetting2"
    },
    "clusters": {
        "local": {
            "refSetting0": "int_refSetting0",
            "refSetting1": "int_refSetting1",
            "refSetting2": "int_refSetting2"
        },
        "test": {
            "refSetting0": "test_refSetting0",
            "refSetting1": "test_refSetting1",
            "refSetting2": "test_refSetting2"
        }
    },
    "machines": {
        "COMPUTERNAME": {
            "refSetting0": "machine_refSetting0"
        }
    }
}

SampleConfiguration.json

{
    "name": "SampleConfiguration",
    "references": [
        { "jar": "ReferenceConfiguration.json" }
    ],
    "defaults": {
        "setting0": "setting0",
        "setting1": "setting1",
        "setting2": "setting2"
    },
    "clusters": {
        "local": {
            "setting0": "int_setting0",
            "setting1": "int_setting1",
            "setting2": "int_setting2"
        },
        "test": {
            "setting0": "test_setting0",
            "setting1": "test_setting1",
            "setting2": "test_setting2"
        }
    }
    "machines": {
        "COMPUTERNAME": {
            "cluster": "local"
            "setting0": "int_setting0",
            "setting1": "int_setting1",
            "setting2": "int_setting2"
        }
    }
}
  • jar file: this is the file containing configuration. In this case SampleConfiguration.json
  • name: The application name. The recommended approach is to name the jar file with the same name
  • defaults: defines configuration keys for the current application and sets default values
  • clusters: defines different environment configurations where the application will be deployed. Here local is the dev environment and test is the place for QA
  • machines: defines configurations for specific machine inside a cluster. The COMPUTERNAME is the default ENV VAR in windows.
  • references: merges two jar files. Same rules apply here. You are not allowed to have the duplicate keys in ref and main jars

In order to install the configurations you will have to use Sett1x.Cli. By default the configurations are applied and stored in environment variables.

HardFork

Sett1x.Consul is a hard fork from the Pandora.Consul library. At the time of the fork Pandora.Consul was v4. Sett1x.Consul will have its own versioning. In order to avoid conflicts all namespaces will be renamed and a separate nuget package is published Sett1x.Consul

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.