Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ support subset + simplify retrieval + template
This commit builds on 1c16800 and: - simplifies the retrieval (via git) to dynamically identify the full list of deployments. Notably it no longer relies on munging command output - supports providing a subset of the deployments via an environment variable It also adds a new function that is lightweight and just prints out the configured URL as a simple template for testing and adapting Testing done: - ran the template function above ``` ./e-mission-py.bash bin/historical/migrations/all_deployments_template.py Connecting to database URLmongodb://localhost:27017/openpath_prod_nc_transit_equity_study Running print_connect_url for ebikegj on DB ebikegj Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_ebikegj', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost:27017/openpath_prod_ebikegj Connecting to database URLmongodb://localhost:27017/openpath_prod_ebikegj Running print_connect_url for cortezebikes on DB cortezebikes Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_cortezebikes', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost:27017/openpath_prod_cortezebikes Connecting to database URLmongodb://localhost:27017/openpath_prod_cortezebikes Running print_connect_url for dcebike on DB dcebike Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_dcebike', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost:27017/openpath_prod_dcebike Connecting to database URLmongodb://localhost:27017/openpath_prod_dcebike Running print_connect_url for washingtoncommons on DB washingtoncommons Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_washingtoncommons', 'DB_RESULT_LIMIT': None} ``` - ran the template function above with an overridden `PROD_LIST`. Note that the first two entries are from final values set to the DB_HOST variable before the program terminated previously. We may want to unset the variable before the program ends ``` $ export PROD_LIST='cortezebikes,fortmorgan' $ ./e-mission-py.bash bin/historical/migrations/all_deployments_template.py Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost/openpath_prod_nrel_commute', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost/openpath_prod_nrel_commute PROD_LIST: ['cortezebikes', 'fortmorgan'] Running print_connect_url for cortezebikes on DB cortezebikes Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_cortezebikes', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost:27017/openpath_prod_cortezebikes Connecting to database URLmongodb://localhost:27017/openpath_prod_cortezebikes Running print_connect_url for fortmorgan on DB fortmorgan Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': 'mongodb://localhost:27017/openpath_prod_fortmorgan', 'DB_RESULT_LIMIT': None} Connecting to database URL mongodb://localhost:27017/openpath_prod_fortmorgan Connecting to database URLmongodb://localhost:27017/openpath_prod_fortmorgan ```
- Loading branch information