ConfigMe is a small, fast, down-to-earth, open source config generation framework and command line utility. It makes generation of real-world configuration files and deployment more fun, more predictable, and more productive. ConfigMe is written in Python.
Project is still in development at 85% completion. That means it works but there no guarantees it won't break. The names, commandline options and code interfaces may change so backward compatibility is currently not guaranteed.
Current unittest coverage stands at 91% using nose + nosexcover line coverage tool.
Source code is located on GitHub: http://github.com/goodwillcoding/configme
- Clone the repo
- Setup a virtualenv environment
- python ./setup develop
- Run configme --help
You can see examples in the ./examples folder of the project
Sample config: ./examples/templates/test.conf
# this is a test config file
ConfigApp "HelloWorld"
AppVerion {{app_version}}Configuration settings file for "dev" role.
A section name for each config file that needs to be generated must be specified and any settings that need to be interpolated into the template. In our case app_version.
Sample config settings: ./examples/settings/dev.settings
[test.conf]
app_version=devSame as above but for "stage" role.
Sample config settings: ./examples/settings/stage.settings
[test.conf]
app_version=stageGenerate config for "dev" and "stage" role by running configme utility and and telling it where to find the configuration templates, the settings file as well where to output the configs.
$ configme \
--templates-path=./examples/templates \
--settings-path=./examples/settings \
--output-path=./examples/output \
--role-name dev
$ configme \
--templates-path=./examples/templates \
--settings-path=./examples/settings \
--output-path=./examples/output \
--role-name stageThe generator has dones the following
- Create a "role" folder in the output folder of ./examples/output The role folder name is the same as role name
- Interpolate the settings file variables into the template
- Write out the config files
Now run the diff command to see the difference.
$ diff -u
./examples/output/dev/test.conf \
./examples/output/stage/test.conf--- ./examples/output/dev/test.conf 2013-01-12 15:54:01.976148562 -0800
+++ ./examples/output/stage/test.conf 2013-01-12 16:13:51.639879447 -0800
@@ -1,4 +1,4 @@
# this is a test config file
ConfigApp "HelloWorld"
-AppVerion dev
\ No newline at end of file
+AppVerion stage
\ No newline at end of fileAs you can see the only difference is are the variables specified in the specific settings file.
For more options run configme --help
usage: configme [-h] -t TEMPLATES_PATH -s SETTINGS_PATH -o OUTPUT_PATH -r
ROLE_NAME [-u ROLE_SUFFIX]
[-b ROLE_VARIABLES [ROLE_VARIABLES ...]]
configme 0.4dev command line utility.
optional arguments:
-h, --help show this help message and exit
-t TEMPLATES_PATH, --templates-path TEMPLATES_PATH
Path to configuration templates folder.
-s SETTINGS_PATH, --settings-path SETTINGS_PATH
Path to settings folder.
-o OUTPUT_PATH, --output-path OUTPUT_PATH
Path to output folder.
-r ROLE_NAME, --role-name ROLE_NAME
Role name.
-u ROLE_SUFFIX, --role-suffix ROLE_SUFFIX
Role suffix.
-b ROLE_VARIABLES [ROLE_VARIABLES ...],
--role-variables ROLE_VARIABLES [ROLE_VARIABLES ...]
Variables that will interpolated into the settings
files.Documentation is in progress of being written and is available here: ConfigMe documentation.
To report bugs, and obtain support please see issue tracker on GitHub Issues
API will be available at the later date when the implementation stabilizes.
ConfigMe is offered under the BSD-derived Repoze Public License.
ConfigMe is produced by the Goodwill Coding.
ConfigMe is developed by Michael R.