autopilotpattern / wordpress

A robust and highly-scalable implementation of WordPress in Docker using the Autopilot Pattern
GNU General Public License v2.0
158 stars 41 forks source link

Implement git2consul #4

Open misterbisson opened 8 years ago

misterbisson commented 8 years ago

git2consul would be a great alternative to the _env being used to inject configuration details to WordPress.

This would eliminate the risk that two users might mistakenly have different _env files and better allow versioning of the configuration data.

My initial attempt at git2consul integration included the following configuration files:

git2consul.json:

{
    "version": "0.0.1",
    "repos": [{
        "name": "triton-wordpress",
        "source_root": "path/in/git/repo",
        "mode" : "expand_keys",
        "url": "https://github.com/misterbisson/triton-wordpress.git",
        "branches": ["progress"],
        "include_branch_name" : false,
        "hooks": [{
            "type": "polling",
            "interval": "1"
        }]
    }]
}

wp-config.json:

{
    "config": [
        { "site_url": "http://my-site.example.com" },

        { "SAVEQUERIES":      true },
        { "WP_DEBUG":         true },
        { "WP_DEBUG_DISPLAY": true },

        { "AUTH_KEY":         "put your unique phrase here" },
        { "SECURE_AUTH_KEY":  "put your unique phrase here" },
        { "LOGGED_IN_KEY":    "put your unique phrase here" },
        { "NONCE_KEY":        "put your unique phrase here" },
        { "AUTH_SALT":        "put your unique phrase here" },
        { "SECURE_AUTH_SALT": "put your unique phrase here" },
        { "LOGGED_IN_SALT":   "put your unique phrase here" },
        { "NONCE_SALT":       "put your unique phrase here" },

        {}
    ]
}