From 2e88782156dcabafe44aae2f27edc20a6e24cf25 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Fri, 10 Jul 2020 21:46:38 -0400 Subject: [PATCH] Create /var/*/celery dirs with sudo * Because these cannot be done by celery itself without sudo, we create the directories with sudo itself beforehand. --- {{cookiecutter.project_slug}}/.travis.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 5c6e9660a..95211b8d9 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -6,6 +6,14 @@ cache: pip python: - "3.8" +env: + global: + - USE_DOCKER="no" + - DATABASE_URL="postgres:///{{ cookiecutter.project_slug }}" + {% if cookiecutter.use_celery == 'y' -%} + - CELERY_BROKER_URL="redis://localhost:6379/0" + {%- endif %} + jobs: include: - name: "Linter" @@ -15,13 +23,6 @@ jobs: - "flake8" - name: "Django Test" - env: - global: - - USE_DOCKER="no" - - DATABASE_URL="postgres:///{{ cookiecutter.project_slug }}" - {% if cookiecutter.use_celery == 'y' -%} - - CELERY_BROKER_URL="redis://localhost:6379/0" - {%- endif %} services: - postgresql {% if cookiecutter.use_celery == 'y' -%} @@ -30,6 +31,10 @@ jobs: install: - pip install -r requirements/local.txt before_script: + {% if cookiecutter.use_celery == 'y' -%} + - sudo mkdir /var/run/celery + - sudo mkdir /var/log/celery - celery multi start worker beat -A config.celery_app --pool=solo + {%- endif %} script: - "pytest"