-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2412 from FJNR-inc/develop
new Release
- Loading branch information
Showing
21 changed files
with
494 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
FROM lambci/lambda:build-python3.8 | ||
FROM python:3.8-slim-buster | ||
|
||
LABEL maintainer="[email protected]" | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
COPY requirements.txt /requirements.txt | ||
COPY requirements-dev.txt /requirements-dev.txt | ||
RUN apt-get update \ | ||
# dependencies for building Python packages | ||
&& apt-get install -y build-essential \ | ||
# psycopg dependencies | ||
&& apt-get install -y libpq-dev \ | ||
# Translations dependencies | ||
&& apt-get install -y gettext \ | ||
# cleaning up unused files | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
|
||
RUN pip --timeout=1000 --no-cache-dir install -r /requirements.txt | ||
RUN pip --timeout=1000 --no-cache-dir install -r /requirements-dev.txt | ||
WORKDIR /app | ||
|
||
# Adds our application code to the image | ||
COPY . . | ||
|
||
RUN pip install -r requirements.txt | ||
RUN pip install -r requirements-dev.txt | ||
|
||
RUN mkdir -p /opt/project | ||
|
||
COPY ./docker/start /start | ||
RUN sed -i 's/\r$//g' /start | ||
RUN chmod +x /start | ||
|
||
COPY ./docker/entrypoint /entrypoint | ||
RUN sed -i 's/\r$//g' /entrypoint | ||
RUN chmod +x /entrypoint | ||
|
||
WORKDIR /opt/project | ||
|
||
ENTRYPOINT ["/entrypoint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.5 on 2024-04-30 16:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('blitz_api', '0030_auto_20230627_0926'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='exportmedia', | ||
name='type', | ||
field=models.CharField(choices=[('ANONYMOUS CHRONO DATA', 'Anonymous Chrono data'), ('OTHER', 'Other'), ('RETREAT SALES', 'Retreat sales'), ('RETREAT PARTICIPATION', 'Retreat participation'), ('RETREAT OPTIONS', 'Retreat options'), ('COUPON USAGE', 'Coupon usage'), ('SALES AND REFUND', 'Sales and refund')], default='OTHER', max_length=255), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
from celery import shared_task | ||
from django.conf import settings | ||
import requests | ||
|
||
|
||
@shared_task | ||
def trigger_task_executions(): | ||
from .cron_function import execute_tasks | ||
|
||
execute_tasks() | ||
|
||
try: | ||
status_url = settings.LOCAL_SETTINGS['STATUS_URLS']['TASK_EXECUTION'] | ||
|
||
if status_url: | ||
requests.get(status_url) | ||
except Exception: | ||
# We don't want to block the task because of a status update | ||
# Status system should already report the error if needed | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# if any of the commands in your code fails for any reason, the entire script fails | ||
set -o errexit | ||
# fail exit if one of your pipe command fails | ||
set -o pipefail | ||
# exits if any of your variables is not set | ||
set -o nounset | ||
|
||
postgres_ready() { | ||
python << END | ||
import sys | ||
import psycopg | ||
try: | ||
psycopg.connect( | ||
dbname="${DB_NAME}", | ||
user="${DB_USER}", | ||
password="${DB_PASSWORD}", | ||
host="${DB_HOST}", | ||
port="${DB_PORT}", | ||
) | ||
except psycopg.OperationalError: | ||
sys.exit(-1) | ||
sys.exit(0) | ||
END | ||
} | ||
until postgres_ready; do | ||
>&2 echo 'Waiting for PostgreSQL to become available...' | ||
sleep 1 | ||
done | ||
>&2 echo 'PostgreSQL is available' | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.