Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit

Permalink
Call AUTO_CONFIGURE_SITE what it is.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Dec 14, 2023
1 parent 91bba3b commit 7542caf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
from sqlalchemy.pool import NullPool
SQLALCHEMY_ENGINE_OPTIONS = {'poolclass': NullPool}

APP = os.environ.get('APP')
ENV = os.environ.get('ENV')

AUTO_CONFIGURE_SITE = bool(int(os.environ.get('AUTO_CONFIGURE_SITE', 0)))

API_BASE_URL = os.environ.get('API_BASE_URL')
API_BASE_URL_EXTERNAL = os.environ.get('API_BASE_URL_EXTERNAL') # used to mock S3 in dev mode and have the browser (which is not running in the docker container) hit the mock directly
BIRDWATCHER_BASE_URL = os.environ.get('BIRDWATCHER_BASE_URL')
Expand Down
2 changes: 1 addition & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def mock_s3(filename):
data = f.read()
return send_file(io.BytesIO(data), mimetype=magic.from_buffer(data, mime=True))

if app.config['APP'] == 'api' and app.config['ENV'] == 'test':
if app.config['AUTO_CONFIGURE_SITE']:
with app.app_context():
app.logger.info("Configuring the site!")
configure_site()
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ version: '3.6'
services:
api:
env_file: .env.test
environment:
- AUTO_CONFIGURE_SITE=1
finalize-auctions:
env_file: .env.test
settle-btc-payments:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ services:
build:
context: ./
dockerfile: ./api/Dockerfile
environment:
- APP=api
image: plebeianmarket-api
depends_on: [db]
restart: on-failure
Expand Down

0 comments on commit 7542caf

Please sign in to comment.