Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions devops/production/bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ prepare_release() {
sync_runtime_env_from_infisical
ensure_private_directory "${ROOT_DIR}/data" 700
ensure_private_directory "${ROOT_DIR}/data/releases" 700
docker_cmd network inspect "${EDGE_NETWORK}" >/dev/null \
docker_cmd network-exists "${EDGE_NETWORK}" >/dev/null \
|| fail "External Docker network ${EDGE_NETWORK} is missing"
docker_cmd network inspect "${DATA_NETWORK}" >/dev/null \
docker_cmd network-exists "${DATA_NETWORK}" >/dev/null \
|| fail "External Docker network ${DATA_NETWORK} is missing"
docker_cmd inspect "${POSTGRES_CONTAINER}" >/dev/null \
|| fail "Shared PostgreSQL container is missing"
Expand Down
18 changes: 18 additions & 0 deletions devops/production/bin/test_production_deploy_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest
from pathlib import Path


DEPLOY_SCRIPT = Path(__file__).with_name("deploy.sh")


class ProductionDeployContractTest(unittest.TestCase):
def test_uses_approved_network_diagnostics(self) -> None:
script = DEPLOY_SCRIPT.read_text(encoding="utf-8")

self.assertIn('docker_cmd network-exists "${EDGE_NETWORK}"', script)
self.assertIn('docker_cmd network-exists "${DATA_NETWORK}"', script)
self.assertNotIn("docker_cmd network inspect", script)


if __name__ == "__main__":
unittest.main()