Skip to content

Commit a59bb99

Browse files
Merge pull request #21 from Geode-solutions/feat/pegghy_config
feat(Config): PEGGHy
2 parents 5ef8252 + 630d751 commit a59bb99

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.github/workflows/CICD.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v3
1515
with:
16-
python-version: "3.9"
16+
python-version: "3.12"
1717
- name: Test
1818
run: |
1919
pip install pytest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.pytest_cache
22
.vscode
33
__pycache__
4-
# __init__.py
4+
.my_py_cache

lambda_function/config.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,46 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None):
165165
"VPC_ID": "vpc-0e58c4d6976fb2aac",
166166
},
167167
},
168+
"PEGGHY": {
169+
"MASTER": {
170+
"API_URL": "https://api.pegghy.geode-solutions.com",
171+
"ASSIGN_PUBLIC_IP": "ENABLED",
172+
"CLUSTER_NAME": "PEGGHy-Master",
173+
"ENVIRONMENT_VARIABLES": {
174+
"name": "geode",
175+
"environment": [{"name": "ID", "value": ID}],
176+
},
177+
"HEALTHCHECK_PORT": 443,
178+
"HEALTHCHECK_ROUTE": f"/{ID}/geode/pegghy_back/healthcheck",
179+
"LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/PEGGHy/fd1a3cd691170720/94cb93fc08a8f221",
180+
"PING_ROUTE": f"/{ID}/geode/opengeodeweb_back/ping",
181+
"ORIGINS": "https://pegghy.geode-solutions.com",
182+
"SECONDS_BETWEEN_TRIES": 0.25,
183+
"SECURITY_GROUP": "sg-0352ea112857ae7b9",
184+
"SUBNET_ID": "subnet-0882d674b17515f6a",
185+
"TASK_DEF_NAME": "PEGGHy-Master",
186+
"VPC_ID": "vpc-0e58c4d6976fb2aac",
187+
},
188+
"NEXT": {
189+
"API_URL": "https://api.pegghy.geode-solutions.com",
190+
"ASSIGN_PUBLIC_IP": "ENABLED",
191+
"CLUSTER_NAME": "PEGGHy-Next",
192+
"ENVIRONMENT_VARIABLES": {
193+
"name": "geode",
194+
"environment": [{"name": "ID", "value": ID}],
195+
},
196+
"HEALTHCHECK_PORT": 443,
197+
"HEALTHCHECK_ROUTE": f"/{ID}/geode/pegghy_back/healthcheck",
198+
"LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/PEGGHy/fd1a3cd691170720/94cb93fc08a8f221",
199+
"PING_ROUTE": f"/{ID}/geode/opengeodeweb_back/ping",
200+
"ORIGINS": "https://next.pegghy.geode-solutions.com",
201+
"SECONDS_BETWEEN_TRIES": 0.25,
202+
"SECURITY_GROUP": "sg-0352ea112857ae7b9",
203+
"SUBNET_ID": "subnet-0882d674b17515f6a",
204+
"TASK_DEF_NAME": "PEGGHy-Next",
205+
"VPC_ID": "vpc-0e58c4d6976fb2aac",
206+
},
207+
},
168208
}
169209

170210
if "/website/" in REQUEST_PATH:
@@ -201,6 +241,14 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None):
201241
task = REQUEST_ORIGIN[8:].split("--geode-solutions.netlify.app")[0]
202242
CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["ORIGINS"] = REQUEST_ORIGIN
203243
CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["TASK_DEF_NAME"] = task
244+
elif "/pegghy/" in REQUEST_PATH:
245+
CONFIG_TYPE = "PEGGHY"
246+
if REQUEST_ORIGIN == "":
247+
CONFIG_ENV = "NEXT"
248+
elif REQUEST_ORIGIN == CONFIG_DICT[CONFIG_TYPE]["MASTER"]["ORIGINS"]:
249+
CONFIG_ENV = "MASTER"
250+
elif REQUEST_ORIGIN == CONFIG_DICT[CONFIG_TYPE]["NEXT"]["ORIGINS"]:
251+
CONFIG_ENV = "NEXT"
204252

205253
self.API_URL = CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["API_URL"]
206254
self.ASSIGN_PUBLIC_IP = CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["ASSIGN_PUBLIC_IP"]

0 commit comments

Comments
 (0)