mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 17:47:08 +03:00
Merge .celery envs file with .django
Rationale: workflow simplification.
This commit is contained in:
parent
418b53bf77
commit
34673ff686
|
@ -249,11 +249,6 @@ def remove_envs_and_associated_files():
|
|||
os.remove('merge_production_dotenvs_in_dotenv.py')
|
||||
|
||||
|
||||
def remove_celery_envs():
|
||||
os.remove(os.path.join('.envs', '.local', '.celery'))
|
||||
os.remove(os.path.join('.envs', '.production', '.celery'))
|
||||
|
||||
|
||||
def remove_celery_compose_dirs():
|
||||
shutil.rmtree(os.path.join('compose', 'local', 'django', 'celery'))
|
||||
shutil.rmtree(os.path.join('compose', 'production', 'django', 'celery'))
|
||||
|
@ -322,7 +317,6 @@ def main():
|
|||
if '{{ cookiecutter.use_celery }}'.lower() == 'n':
|
||||
remove_celery_app()
|
||||
if '{{ cookiecutter.use_docker }}'.lower() == 'y':
|
||||
remove_celery_envs()
|
||||
remove_celery_compose_dirs()
|
||||
|
||||
if '{{ cookiecutter.use_travisci }}'.lower() == 'n':
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
CELERY_BROKER_URL=redis://redis:6379/0
|
|
@ -1,3 +1,8 @@
|
|||
# General
|
||||
# ------------------------------------------------------------------------------
|
||||
USE_DOCKER=yes
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
CELERY_BROKER_URL=redis://redis:6379/0
|
||||
{% endif %}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
CELERY_BROKER_URL=redis://redis:6379/0
|
|
@ -16,7 +16,11 @@ DJANGO_SECURE_SSL_REDIRECT=False
|
|||
MAILGUN_API_KEY=
|
||||
DJANGO_SERVER_EMAIL=
|
||||
MAILGUN_DOMAIN=
|
||||
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
CELERY_BROKER_URL=redis://redis:6379/0
|
||||
{% endif %}
|
||||
# AWS
|
||||
# ------------------------------------------------------------------------------
|
||||
DJANGO_AWS_ACCESS_KEY_ID=
|
||||
|
|
|
@ -19,9 +19,6 @@ services:
|
|||
env_file:
|
||||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
- ./.envs/.local/.celery
|
||||
{%- endif %}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
command: /start.sh
|
||||
|
@ -57,7 +54,7 @@ services:
|
|||
- mailhog
|
||||
{%- endif %}
|
||||
env_file:
|
||||
- ./.envs/.local/.celery
|
||||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports: []
|
||||
command: /start-celeryworker.sh
|
||||
|
@ -71,7 +68,7 @@ services:
|
|||
- mailhog
|
||||
{%- endif %}
|
||||
env_file:
|
||||
- ./.envs/.local/.celery
|
||||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports: []
|
||||
command: /start-celerybeat.sh
|
||||
|
|
|
@ -8,9 +8,6 @@ PRODUCTION_DOTENVS_DIR_PATH = os.path.join(ROOT_DIR_PATH, '.envs', '.production'
|
|||
PRODUCTION_DOTENV_FILE_PATHS = [
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.django'),
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.postgres'),
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.celery'),
|
||||
{%- endif %}
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.caddy'),
|
||||
]
|
||||
DOTENV_FILE_PATH = os.path.join(ROOT_DIR_PATH, '.env')
|
||||
|
|
|
@ -16,9 +16,6 @@ services:
|
|||
env_file:
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
- ./.envs/.production/.celery
|
||||
{%- endif %}
|
||||
command: /gunicorn.sh
|
||||
|
||||
postgres:
|
||||
|
@ -55,7 +52,7 @@ services:
|
|||
- postgres
|
||||
- redis
|
||||
env_file:
|
||||
- ./.envs/.production/.celery
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
command: /start-celeryworker.sh
|
||||
|
||||
|
@ -65,7 +62,7 @@ services:
|
|||
- postgres
|
||||
- redis
|
||||
env_file:
|
||||
- ./.envs/.production/.celery
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
command: /start-celerybeat.sh
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user