Skip to content

Commit

Permalink
ci: in memory channel layer for cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelobbfonseca committed Nov 27, 2023
1 parent 71d6a8c commit b1ca05e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
branches:
- main

# env:
env:
CICD: true
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# HEROKU_APP_NAME: your-heroku-app-name

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ Run bash inside the application container. Run ```docker exec -it tournament-api

### Seed Database

`python3 manage.py shell < seed.py`
`python3 manage.py shell < seed.py`

#### Seed Fixtures

`manage.py loaddata fixtures/player.json`
`manage.py loaddata fixtures/position.json`
`manage.py loaddata fixtures/tournament.json`

17 changes: 9 additions & 8 deletions tournament_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get('DEBUG', True)
CICD = os.environ.get('CICD', False)

ALLOWED_HOSTS = [
'elimination-tournament.onrender.com',
Expand Down Expand Up @@ -95,15 +96,15 @@

WSGI_APPLICATION = 'tournament_api.wsgi.application'
ASGI_APPLICATION = "tournament_api.asgi.application"

CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("redis", 6379)],
if not CICD:
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("redis", 6379)],
},
},
},
}
}

# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

Expand Down

0 comments on commit b1ca05e

Please sign in to comment.