Skip to content

Commit

Permalink
Get the first GMT scenario giving a passing result
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed May 16, 2024
1 parent 9a06c88 commit 699316a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

services:
db:
mariadb:
image: mariadb:10.11
restart: always
environment:
Expand Down
5 changes: 4 additions & 1 deletion greenweb/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
INTERNAL_IPS = ["127.0.0.1"]
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + "1" for ip in ips]
ALLOWED_HOSTS.extend(["127.0.0.1", "localhost"]) # noqa

# django is added to allow for the app to server requests in a
# docker compose environment, or in green metrics tool
ALLOWED_HOSTS.extend(["127.0.0.1", "localhost", "django"]) # noqa

INSTALLED_APPS.append("debug_toolbar") # noqa

Expand Down
26 changes: 19 additions & 7 deletions usage_scenario.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ services:
- MYSQL_DATABASE=greencheck
- MYSQL_USER=deploy
- MYSQL_PASSWORD=deploy
# not sure which of these take precedence now
# env:
# MYSQL_ROOT_PASSWORD: just-for-github-actions
# MYSQL_DATABASE: greencheck
networks:
- greencheck-network

Expand All @@ -45,13 +41,25 @@ services:
build:
context: .
dockerfile: Dockerfile

# if we need to inspect the container, and make changes between runs
# mounting the volumes below allows for change to the most commonly
# changed files without needing to rebuild the container
# volumes:
# - ./apps:/app/apps
# - ./greenweb:/app/greenweb
# we use sleep 5 as a hack to wait for the database to be ready
setup-commands:
- sleep 5
- python manage.py migrate
- python manage.py collectstatic --noinput
environment:
- PORT=9000
- GUNICORN_BIND_IP=0.0.0.0
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
- DATABASE_URL=mysql://deploy:deploy@db:3306/greencheck
- DATABASE_URL_READ_ONLY=mysql://deploy:deploy@db:3306/greencheck
- DATABASE_URL=mysql://deploy:deploy@mariadb:3306/greencheck
- DATABASE_URL_READ_ONLY=mysql://deploy:deploy@mariadb:3306/greencheck
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
- DJANGO_SETTINGS_MODULE=greenweb.settings.development
ports:
Expand Down Expand Up @@ -85,11 +93,15 @@ flow:
container: test-container
commands:
- type: console
# this should trigger a http request to an API endpoint of http://django:9000, which should be the greencheck API
command: npm test
note: Starting test
read-notes-stdout: true
stdin_open: true
log-stdout: true
log-stderr: true
tty: true
- type: console
command: sleep 30
note: Idling
- type: console
command: npm test
Expand Down

0 comments on commit 699316a

Please sign in to comment.