Skip to content

Commit

Permalink
fix: tpl env
Browse files Browse the repository at this point in the history
  • Loading branch information
Morriz committed Feb 17, 2024
1 parent 31c0fb6 commit 6ab69a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions bin/start-api.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env sh
. .venv/bin/activate

kill $(fuser 8888/tcp 2>/dev/null | awk '{ print $1 }')

PYTHONPATH=. python api/main.py main:app &
6 changes: 3 additions & 3 deletions lib/upstream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from unittest import TestCase, mock
from unittest.mock import Mock, call

from lib.models import Project
from lib.models import Env, Project

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

Expand Down Expand Up @@ -73,10 +73,10 @@ def test_write_upstream(
image="morriz/hello-world:main",
name="master",
port=8080,
env={"TARGET": "cost concerned people", "INFORMANT": "http://test-informant:8080"},
env=Env(**{"TARGET": "cost concerned people", "INFORMANT": "http://test-informant:8080"}),
volumes=["./data/bla:/data/bla", "./etc/dida:/etc/dida"],
),
Service(image="morriz/hello-world:main", name="informant", port=8080, env={"TARGET": "boss"}),
Service(image="morriz/hello-world:main", name="informant", port=8080, env=Env(**{"TARGET": "boss"})),
]

# Call the function under test
Expand Down
2 changes: 1 addition & 1 deletion tpl/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
restart: unless-stopped
{% if s.env -%}
environment:
{% for k, v in s.env.items() -%}
{% for k, v in s.env -%}
{{ k }}: {{ v }}
{% endfor -%}
{% endif %}
Expand Down

0 comments on commit 6ab69a8

Please sign in to comment.