mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-05-03 06:43:45 +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')
|
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():
|
def remove_celery_compose_dirs():
|
||||||
shutil.rmtree(os.path.join('compose', 'local', 'django', 'celery'))
|
shutil.rmtree(os.path.join('compose', 'local', 'django', 'celery'))
|
||||||
shutil.rmtree(os.path.join('compose', 'production', 'django', 'celery'))
|
shutil.rmtree(os.path.join('compose', 'production', 'django', 'celery'))
|
||||||
|
@ -322,7 +317,6 @@ def main():
|
||||||
if '{{ cookiecutter.use_celery }}'.lower() == 'n':
|
if '{{ cookiecutter.use_celery }}'.lower() == 'n':
|
||||||
remove_celery_app()
|
remove_celery_app()
|
||||||
if '{{ cookiecutter.use_docker }}'.lower() == 'y':
|
if '{{ cookiecutter.use_docker }}'.lower() == 'y':
|
||||||
remove_celery_envs()
|
|
||||||
remove_celery_compose_dirs()
|
remove_celery_compose_dirs()
|
||||||
|
|
||||||
if '{{ cookiecutter.use_travisci }}'.lower() == 'n':
|
if '{{ cookiecutter.use_travisci }}'.lower() == 'n':
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# Celery
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
CELERY_BROKER_URL=redis://redis:6379/0
|
|
|
@ -1,3 +1,8 @@
|
||||||
# General
|
# General
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
USE_DOCKER=yes
|
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=
|
MAILGUN_API_KEY=
|
||||||
DJANGO_SERVER_EMAIL=
|
DJANGO_SERVER_EMAIL=
|
||||||
MAILGUN_DOMAIN=
|
MAILGUN_DOMAIN=
|
||||||
|
{% if cookiecutter.use_celery == "y" %}
|
||||||
|
# Celery
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
|
{% endif %}
|
||||||
# AWS
|
# AWS
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
DJANGO_AWS_ACCESS_KEY_ID=
|
DJANGO_AWS_ACCESS_KEY_ID=
|
||||||
|
|
|
@ -19,9 +19,6 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
|
||||||
- ./.envs/.local/.celery
|
|
||||||
{%- endif %}
|
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
command: /start.sh
|
command: /start.sh
|
||||||
|
@ -57,7 +54,7 @@ services:
|
||||||
- mailhog
|
- mailhog
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.celery
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
ports: []
|
ports: []
|
||||||
command: /start-celeryworker.sh
|
command: /start-celeryworker.sh
|
||||||
|
@ -71,7 +68,7 @@ services:
|
||||||
- mailhog
|
- mailhog
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.celery
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
ports: []
|
ports: []
|
||||||
command: /start-celerybeat.sh
|
command: /start-celerybeat.sh
|
||||||
|
|
|
@ -8,9 +8,6 @@ PRODUCTION_DOTENVS_DIR_PATH = os.path.join(ROOT_DIR_PATH, '.envs', '.production'
|
||||||
PRODUCTION_DOTENV_FILE_PATHS = [
|
PRODUCTION_DOTENV_FILE_PATHS = [
|
||||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.django'),
|
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.django'),
|
||||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.postgres'),
|
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'),
|
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, '.caddy'),
|
||||||
]
|
]
|
||||||
DOTENV_FILE_PATH = os.path.join(ROOT_DIR_PATH, '.env')
|
DOTENV_FILE_PATH = os.path.join(ROOT_DIR_PATH, '.env')
|
||||||
|
|
|
@ -16,9 +16,6 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.production/.django
|
- ./.envs/.production/.django
|
||||||
- ./.envs/.production/.postgres
|
- ./.envs/.production/.postgres
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
|
||||||
- ./.envs/.production/.celery
|
|
||||||
{%- endif %}
|
|
||||||
command: /gunicorn.sh
|
command: /gunicorn.sh
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
|
@ -55,7 +52,7 @@ services:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.production/.celery
|
- ./.envs/.production/.django
|
||||||
- ./.envs/.production/.postgres
|
- ./.envs/.production/.postgres
|
||||||
command: /start-celeryworker.sh
|
command: /start-celeryworker.sh
|
||||||
|
|
||||||
|
@ -65,7 +62,7 @@ services:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.production/.celery
|
- ./.envs/.production/.django
|
||||||
- ./.envs/.production/.postgres
|
- ./.envs/.production/.postgres
|
||||||
command: /start-celerybeat.sh
|
command: /start-celerybeat.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user