Generate app ports in catalog and gateway
This commit is contained in:
@@ -24,24 +24,49 @@ SELECT
|
||||
version,
|
||||
status,
|
||||
COALESCE(memory, ''),
|
||||
COALESCE(cpus, '')
|
||||
COALESCE(cpus, ''),
|
||||
COALESCE(container_port, 8000),
|
||||
COALESCE(health_url, '/health'),
|
||||
COALESCE(runtime, ''),
|
||||
COALESCE(template, '')
|
||||
FROM apps
|
||||
WHERE is_enabled = 1
|
||||
ORDER BY id
|
||||
""").fetchall()
|
||||
|
||||
lines = ["apps:"]
|
||||
|
||||
for row in rows:
|
||||
app_id, name, language, version, status, memory, cpus = row
|
||||
(
|
||||
app_id,
|
||||
name,
|
||||
language,
|
||||
version,
|
||||
status,
|
||||
memory,
|
||||
cpus,
|
||||
container_port,
|
||||
health_url,
|
||||
runtime,
|
||||
template,
|
||||
) = row
|
||||
|
||||
if not str(health_url).startswith("/"):
|
||||
health_path = "/health"
|
||||
else:
|
||||
health_path = health_url
|
||||
|
||||
lines.append("")
|
||||
lines.append(f" - id: {app_id}")
|
||||
lines.append(f" name: {name}")
|
||||
lines.append(f" language: {language}")
|
||||
lines.append(f" runtime: {runtime}")
|
||||
lines.append(f" template: {template}")
|
||||
lines.append(f" version: {version}")
|
||||
lines.append(f" container_port: {container_port}")
|
||||
lines.append(f" base_path: /apps/{app_id}")
|
||||
lines.append(f" docs: /apps/{app_id}/docs")
|
||||
lines.append(f" health: /apps/{app_id}/health")
|
||||
lines.append(f" health: /apps/{app_id}{health_path}")
|
||||
lines.append(f" status: {status}")
|
||||
|
||||
if memory:
|
||||
|
||||
Reference in New Issue
Block a user