Compare commits
No commits in common. "c7d7a9af8a12d25a0fa3760a0cc3f89119c0a513" and "fafffe56c4d5febf8818db41971b4cabd4782372" have entirely different histories.
c7d7a9af8a
...
fafffe56c4
2 changed files with 1 additions and 38 deletions
2
app.py
2
app.py
|
|
@ -1124,7 +1124,7 @@ os.chmod(env, 0o600)
|
|||
if rc != 0:
|
||||
_ssh(VPS_SSH, rollback, timeout=180)
|
||||
raise RuntimeError(f"StreamScope build preflight failed: {err[-500:]}")
|
||||
deploy = "cd /app-config/github/speedtest && (docker rm -f speedtest >/dev/null 2>&1 || true) && docker compose up -d --remove-orphans"
|
||||
deploy = "cd /app-config/github/speedtest && docker compose up -d --remove-orphans"
|
||||
rc, out, err = _ssh(VPS_SSH, deploy, timeout=180)
|
||||
if rc != 0:
|
||||
_ssh(VPS_SSH, rollback, timeout=180)
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
import app
|
||||
|
||||
|
||||
def test_streamscope_deploy_replaces_legacy_container_before_compose(monkeypatch):
|
||||
files = {path: "placeholder" for path in app.SPEEDTEST_REPO_FILES}
|
||||
files["compose.yaml"] = """services:
|
||||
streamscope:
|
||||
build: .
|
||||
ports:
|
||||
- '127.0.0.1:8080:8080'
|
||||
environment:
|
||||
ADMIN_PASSWORD: "${ADMIN_PASSWORD:?required}"
|
||||
SESSION_SECRET: "${SESSION_SECRET:?required}"
|
||||
volumes:
|
||||
- /app-config/speedtest/data:/data
|
||||
cap_add:
|
||||
- NET_RAW
|
||||
"""
|
||||
files["Dockerfile"] = "FROM python:3.13-slim\nRUN apt-get install -y mtr-tiny\n"
|
||||
commands = []
|
||||
|
||||
monkeypatch.setattr(app, "_remote_python", lambda script: (0, "", ""))
|
||||
|
||||
def fake_ssh(host, command, timeout=600):
|
||||
commands.append(command)
|
||||
return 0, "ok", ""
|
||||
|
||||
monkeypatch.setattr(app, "_ssh", fake_ssh)
|
||||
result = app._deploy_speedtest_compose(
|
||||
files,
|
||||
"correct-horse-battery-staple",
|
||||
"streamscope-session-secret-with-entropy",
|
||||
)
|
||||
|
||||
deploy = next(command for command in commands if "compose up -d --remove-orphans" in command)
|
||||
assert "docker rm -f speedtest" in deploy
|
||||
assert result["application"] == "streamscope"
|
||||
Loading…
Add table
Add a link
Reference in a new issue