Adding wrolpi-app-dev which runs frontend in dev mode.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2025-12-18 18:01:45 -07:00
parent 7e9e815bf6
commit a02c47cfa1
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 30 additions and 1 deletions

View file

@ -50,6 +50,15 @@ DEFAULT_CONFIG = {
"use_https": False,
"description": "React frontend",
},
{
"name": "wrolpi-app-dev",
"systemd_name": "wrolpi-app-dev",
"port": 3000,
"viewable": False,
"use_https": False,
"description": "React frontend (Development)",
"show_only_when_running": True,
},
{
"name": "wrolpi-help",
"systemd_name": "wrolpi-help",

View file

@ -57,12 +57,15 @@ class TestManagedServicesConfig:
def test_managed_services_count(self):
"""Should have expected number of managed services."""
services = DEFAULT_CONFIG["managed_services"]
assert len(services) == 10
assert len(services) == 12
@pytest.mark.parametrize("name,expected", [
("wrolpi-api",
{"systemd_name": "wrolpi-api", "port": 8081, "viewable": True, "description": "Python API (Sanic)"}),
("wrolpi-api-dev",
{"systemd_name": "wrolpi-api-dev", "port": 8081, "viewable": True, "show_only_when_running": True}),
("wrolpi-app", {"port": 3000, "viewable": False}),
("wrolpi-app-dev", {"port": 3000, "viewable": False, "show_only_when_running": True}),
("nginx", {"port": 80}),
("postgresql", {"port": 5432, "viewable": False}),
("wrolpi-upgrade", {"port": None, "viewable": False, "show_only_when_running": True}),

View file

@ -0,0 +1,16 @@
[Unit]
Description=WROLPi React APP (Development)
Wants=wrolpi-api.service
PartOf=wrolpi.target
Conflicts=wrolpi-app.service
[Service]
Environment=PORT=3000
ExecStart=/usr/bin/npm start
Group=wrolpi
User=wrolpi
WorkingDirectory=/opt/wrolpi/app/
Nice=6
[Install]
WantedBy=default.target

View file

@ -2,6 +2,7 @@
Description=WROLPi React APP
Wants=wrolpi-api.service
PartOf=wrolpi.target
Conflicts=wrolpi-app-dev.service
[Service]
# Use explicit `serve.json` so `epub.html` is not lost.