3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/16726c4310a7/ changeset: 16726c4310a7 user: jmchilton date: 2012-05-04 07:12:43 summary: Augment run.sh to search for the optional environment variable GALAXY_UNIVERSE_CONFIG_DIR. If this is set, before Galaxy is launched the directory specified by the environment variable is searched for ini config files. These files are merged into a single configuration structure and written back out as universe.ini. This should allow for a more modular configuration of Galaxy. The files are merged in lexiographic order and later files can override properties specified ealier on. If a consistent naming scheme is used this can be really useful: As an example, one might specify the files as such: 000_galaxy_defaults.ini 000_default_sqlite_config.ini 100_institution_specific.ini 500_job_runner.ini 500_webapp_0.ini 500_webapp_1.ini 500_instance_specific.ini 500_available_postgres.ini affected #: 2 files diff -r 1eb32dbab2c1a0bc308eb4d3a069fa55ff6ecb83 -r 16726c4310a71be907ebdcbf850dcd7ce72797b4 run.sh --- a/run.sh +++ b/run.sh @@ -33,6 +33,10 @@ fi done +if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then + python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR" +fi + # explicitly attempt to fetch eggs before running FETCH_EGGS=1 for arg in "$@"; do diff -r 1eb32dbab2c1a0bc308eb4d3a069fa55ff6ecb83 -r 16726c4310a71be907ebdcbf850dcd7ce72797b4 scripts/build_universe_config.py --- /dev/null +++ b/scripts/build_universe_config.py @@ -0,0 +1,26 @@ +from ConfigParser import ConfigParser +from os import listdir +from os.path import join +from re import match +from sys import argv + + +def merge(): + "Merges all .ini files in a specified directory into ./universe.ini" + if len(argv) < 2: + message = "%s: Must specify directory to merge configuration files from." % argv[0] + raise Exception(message) + conf_directory = argv[1] + conf_files = [f for f in listdir(conf_directory) if match(r'.*\.ini', f)] + conf_files.sort() + + parser = ConfigParser() + for conf_file in conf_files: + parser.read([join(conf_directory, conf_file)]) + ## TODO: Expand enviroment variables here, that would + ## also make Galaxy much easier to configure. + + parser.write(open("universe.ini", 'w')) + +if __name__ == '__main__': + merge() https://bitbucket.org/galaxy/galaxy-central/changeset/6f4b97fd803e/ changeset: 6f4b97fd803e user: jmchilton date: 2012-05-24 14:47:14 summary: Fix a typo. affected #: 1 file diff -r 16726c4310a71be907ebdcbf850dcd7ce72797b4 -r 6f4b97fd803e6ab97192d8454bc71bff145e5695 scripts/build_universe_config.py --- a/scripts/build_universe_config.py +++ b/scripts/build_universe_config.py @@ -20,7 +20,7 @@ ## TODO: Expand enviroment variables here, that would ## also make Galaxy much easier to configure. - parser.write(open("universe.ini", 'w')) + parser.write(open("universe_wsgi.ini", 'w')) if __name__ == '__main__': merge() https://bitbucket.org/galaxy/galaxy-central/changeset/7566c91c1ec6/ changeset: 7566c91c1ec6 user: natefoo date: 2012-08-15 16:57:14 summary: Merged in jmchilton/galaxy-central-configuration-directory (pull request #44) affected #: 2 files diff -r b2fd558879b99de125f4554ba5e15b726bd8431c -r 7566c91c1ec65f90c52f173ff1a5442789028f93 run.sh --- a/run.sh +++ b/run.sh @@ -36,6 +36,10 @@ fi done +if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then + python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR" +fi + # explicitly attempt to fetch eggs before running FETCH_EGGS=1 for arg in "$@"; do diff -r b2fd558879b99de125f4554ba5e15b726bd8431c -r 7566c91c1ec65f90c52f173ff1a5442789028f93 scripts/build_universe_config.py --- /dev/null +++ b/scripts/build_universe_config.py @@ -0,0 +1,26 @@ +from ConfigParser import ConfigParser +from os import listdir +from os.path import join +from re import match +from sys import argv + + +def merge(): + "Merges all .ini files in a specified directory into ./universe.ini" + if len(argv) < 2: + message = "%s: Must specify directory to merge configuration files from." % argv[0] + raise Exception(message) + conf_directory = argv[1] + conf_files = [f for f in listdir(conf_directory) if match(r'.*\.ini', f)] + conf_files.sort() + + parser = ConfigParser() + for conf_file in conf_files: + parser.read([join(conf_directory, conf_file)]) + ## TODO: Expand enviroment variables here, that would + ## also make Galaxy much easier to configure. + + parser.write(open("universe_wsgi.ini", 'w')) + +if __name__ == '__main__': + merge() Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.