Configure HAProxy stats and improve test fixture cleanup logic
- Set up HAProxy stats environment variables (`HAPROXY_USERNAME`, `HAPROXY_PASSWORD`, `HAPROXY_STATS_PORT`) for monitoring. - Updated test fixture to ensure robust cleanup with try-finally blocks.
This commit is contained in:
parent
d926cd7e69
commit
00b7bac5c0
2 changed files with 19 additions and 10 deletions
|
|
@ -94,6 +94,7 @@ services:
|
||||||
|
|
||||||
# EasyHAProxy with Certbot
|
# EasyHAProxy with Certbot
|
||||||
haproxy:
|
haproxy:
|
||||||
|
image: byjg/easy-haproxy:local
|
||||||
build:
|
build:
|
||||||
context: ../..
|
context: ../..
|
||||||
dockerfile: deploy/docker/Dockerfile
|
dockerfile: deploy/docker/Dockerfile
|
||||||
|
|
@ -111,6 +112,9 @@ services:
|
||||||
environment:
|
environment:
|
||||||
EASYHAPROXY_DISCOVER: docker
|
EASYHAPROXY_DISCOVER: docker
|
||||||
HAPROXY_CUSTOMERRORS: "true"
|
HAPROXY_CUSTOMERRORS: "true"
|
||||||
|
HAPROXY_USERNAME: admin
|
||||||
|
HAPROXY_PASSWORD: password
|
||||||
|
HAPROXY_STATS_PORT: 1936
|
||||||
|
|
||||||
# Certbot configuration pointing to Pebble
|
# Certbot configuration pointing to Pebble
|
||||||
EASYHAPROXY_CERTBOT_EMAIL: test@example.com
|
EASYHAPROXY_CERTBOT_EMAIL: test@example.com
|
||||||
|
|
|
||||||
|
|
@ -842,10 +842,15 @@ def docker_compose_acme() -> Generator[None, None, None]:
|
||||||
)
|
)
|
||||||
|
|
||||||
fixture = DockerComposeFixture(str(DOCKER_DIR / "docker-compose-acme-e2e.yml"), startup_wait=0)
|
fixture = DockerComposeFixture(str(DOCKER_DIR / "docker-compose-acme-e2e.yml"), startup_wait=0)
|
||||||
|
try:
|
||||||
fixture.up()
|
fixture.up()
|
||||||
yield
|
except Exception:
|
||||||
|
fixture.down()
|
||||||
|
raise
|
||||||
|
try:
|
||||||
|
yield
|
||||||
|
finally:
|
||||||
fixture.down()
|
fixture.down()
|
||||||
|
|
||||||
# Clean up volume after test
|
# Clean up volume after test
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["docker", "volume", "rm", volume_name],
|
["docker", "volume", "rm", volume_name],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue