-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from OpenHistoricalMap/staging
Updates from staging
- Loading branch information
Showing
29 changed files
with
1,700 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
if: github.ref == 'refs/heads/staging' | ||
uses: allenevans/[email protected] | ||
with: | ||
NOMINATIM_API: 'https://nominatim-api-staging.openhistoricalmap.org/' | ||
NOMINATIM_API: 'https://nominatim-api.staging.openhistoricalmap.org/' | ||
NOMINATIM_BUCKET: 'nominatim-staging.openhistoricalmap.org' | ||
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_NOMINATIM_CLOUDFRONT_ID }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
if: github.ref == 'refs/heads/staging' | ||
uses: allenevans/[email protected] | ||
with: | ||
OVERPASS_API: overpass-api-staging.openhistoricalmap.org | ||
OVERPASS_API: overpass-api.staging.openhistoricalmap.org | ||
OVERPASS_BUCKET: overpass-turbo-staging.openhistoricalmap.org | ||
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_OVERPASS_CLOUDFRONT_ID }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
uses: allenevans/[email protected] | ||
with: | ||
TM_APP_BASE_URL: https://tasks-staging.openhistoricalmap.org | ||
TM_APP_API_URL: https://staging-tm-api.openhistoricalmap.org | ||
TM_APP_API_URL: https://tm-api.staging.openhistoricalmap.org | ||
TM_APP_API_VERSION: v2 | ||
TM_ORG_NAME: OpenHistoricalMap | ||
TM_ORG_CODE: OHM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ values.dev.yaml | |
secrets | ||
tegola | ||
envs/.env.tiler | ||
envs/.env.web | ||
envs/.env.web | ||
config.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
import argparse | ||
parser = argparse.ArgumentParser(description='Merge TOML files into a configuration file.') | ||
parser.add_argument('--template', default='config/config.template.toml', help='Path to the configuration template file.') | ||
parser.add_argument('--providers', default='config/providers', help='Directory containing provider TOML files.') | ||
parser.add_argument('--output', default='config/config.toml', help='Output configuration file path.') | ||
args = parser.parse_args() | ||
|
||
config_template_file = args.template | ||
providers_dir = args.providers | ||
output_file_path = args.output | ||
toml_files = [file for file in os.listdir(providers_dir) if file.endswith(".toml")] | ||
|
||
# Read TOML files | ||
new_configs = {} | ||
for toml_file in toml_files: | ||
dir_toml_file = os.path.join(providers_dir, toml_file) | ||
with open(dir_toml_file, "r") as file: | ||
new_configs[dir_toml_file] = file.read() | ||
|
||
with open(config_template_file, "r") as main_file: | ||
content = main_file.read() | ||
|
||
# Replace the content of main.toml with the content read from other TOML files | ||
for toml_file, new_config in new_configs.items(): | ||
print(f"Copy {toml_file} to config.toml") | ||
section_header = "[['{}']]".format(toml_file.replace("config/", "")) | ||
indentation_level = content.find(section_header) | ||
if indentation_level != -1: | ||
# Find the appropriate number of tabs or spaces for indentation | ||
preceding_newline = content.rfind('\n', 0, indentation_level) | ||
indentation = content[preceding_newline + 1:indentation_level] | ||
content = content.replace(section_header, new_config.replace("\n", "\n" + indentation)) | ||
|
||
with open(output_file_path, "w") as output_file: | ||
output_file.write(content) |
Oops, something went wrong.