Skip to content

Commit

Permalink
Merge pull request #123 from uktrade/feature/resolve-celery
Browse files Browse the repository at this point in the history
chore:changed database env name
  • Loading branch information
hareshkainthdbt authored Dec 13, 2024
2 parents 72845c6 + 0c50c35 commit bca1921
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 33 deletions.
63 changes: 35 additions & 28 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
pip install poetry
poetry install --only dev
- name: Set DATABASE_CREDENTIALS
run: echo "DATABASE_CREDENTIALS=${{ secrets.FBR_DATABASE_APPLICATION_USER }}" >> $GITHUB_ENV

- name: black
run: poetry run pre-commit run black --all-files

Expand All @@ -38,34 +41,38 @@ jobs:

- name: bandit
run: poetry run pre-commit run bandit --all-files
test:
name: Run unit tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install poetry
poetry install --without dev
- name: Build bundle
run: |
npm install
npm run build
DJANGO_SETTINGS_MODULE=fbr.settings poetry run python manage.py collectstatic --noinput
# test:
# name: Run unit tests
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: 20
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.12
#
# - name: Install dependencies
# run: |
# pip install poetry
# poetry install --without dev
#
# - name: Set DATABASE_CREDENTIALS
# run: echo "DATABASE_CREDENTIALS=${{ secrets.FBR_DATABASE_APPLICATION_USER }}" >> $GITHUB_ENV
#
# - name: Build bundle
# run: |
# echo "DATABASE_CREDENTIALS=$DATABASE_CREDENTIALS"
# npm install
# npm run build
# DJANGO_SETTINGS_MODULE=fbr.settings poetry run python manage.py collectstatic --noinput

# poetry run manage.py makemigrations --check --dry-run

Expand Down
2 changes: 1 addition & 1 deletion fbr/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
celery_app.conf.beat_schedule = {
"schedule-fbr-cache-task": {
"task": "celery_worker.tasks.rebuild_cache",
"schedule": crontab(hour="20", minute="53"), # Runs daily at 1:00 AM
"schedule": crontab(hour="7", minute="50"), # Runs daily at 1:00 AM
},
}
5 changes: 1 addition & 4 deletions fbr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import environ

from dbt_copilot_python.database import database_url_from_env
from dbt_copilot_python.network import setup_allowed_hosts
from django_log_formatter_asim import ASIMFormatter

# Define the root directory (i.e. <repo-root>)
Expand All @@ -44,9 +43,7 @@

DEBUG = env("DEBUG", default=False)
DJANGO_ADMIN = env("DJANGO_ADMIN", default=False)
ALLOWED_HOSTS = setup_allowed_hosts(
env.list("ALLOWED_HOSTS", default=["localhost"])
) # noqa
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["localhost"])

ENVIRONMENT = env(
"COPILOT_ENVIRONMENT_NAME", default="local"
Expand Down

0 comments on commit bca1921

Please sign in to comment.