Skip to content

Commit

Permalink
Update tox configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jun 18, 2024
1 parent d970ea9 commit ca61be5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
15 changes: 8 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ docker =
docker: db-vlc
docker: minio-vlc
setenv =
docker: VLC_DEV_DB_HOST=localhost
docker: VLC_DEV_DB_PORT=9010
docker: VLC_DEV_AWS_S3_ENDPOINT_URL=http://localhost:9011
COVERAGE_FILE = .coverage.{envname}
allowlist_externals =
poetry
Expand All @@ -35,8 +32,10 @@ environment =
POSTGRES_USER=vlc
POSTGRES_PASSWORD=test
POSTGRES_DB=test_virtual_library_card_dev
ports =
9010:5432/tcp
expose =
VLC_DEV_AWS_S3_ENDPOINT_URL_PORT=5432/tcp
host_var =
VLC_DEV_AWS_S3_ENDPOINT_URL_HOST
healthcheck_cmd = pg_isready
healthcheck_interval = 5
healthcheck_retries = 10
Expand All @@ -47,8 +46,10 @@ environment =
MINIO_ACCESS_KEY=vlc-minio
MINIO_SECRET_KEY=123456789
MINIO_DEFAULT_BUCKETS=vlc-test:download
ports =
9011:9000/tcp
expose =
VLC_DEV_DB_PORT=9000/tcp
host_var =
VLC_DEV_DB_HOST

[gh-actions]
python =
Expand Down
13 changes: 10 additions & 3 deletions virtual_library_card/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@
DEFAULT_FILE_STORAGE = "virtual_library_card.storage.S3PublicStorage"
STATICFILES_STORAGE = "virtual_library_card.storage.S3StaticStorage"
AWS_STORAGE_BUCKET_NAME = "vlc-test"
AWS_S3_ENDPOINT_URL = os.environ.get(
"VLC_DEV_AWS_S3_ENDPOINT_URL", "http://localhost:9000"
)
if "AWS_S3_ENDPOINT_URL" in os.environ:
AWS_S3_ENDPOINT_URL = os.environ["AWS_S3_ENDPOINT_URL"]
elif (
"AWS_S3_ENDPOINT_URL_HOST" in os.environ
and "AWS_S3_ENDPOINT_URL_PORT" in os.environ
):
AWS_S3_ENDPOINT_URL = f"http://{os.environ['AWS_S3_ENDPOINT_URL_HOST']}:{os.environ['AWS_S3_ENDPOINT_URL_PORT']}"
else:
AWS_S3_ENDPOINT_URL = "http://localhost:9000"

AWS_S3_CUSTOM_DOMAIN = os.environ.get("VLC_DEV_AWS_S3_CUSTOM_DOMAIN", False)
AWS_S3_URL_PROTOCOL = os.environ.get("VLC_DEV_AWS_S3_URL_PROTOCOL", "https:")

Expand Down

0 comments on commit ca61be5

Please sign in to comment.