From 68e83a198dd0ae43851db67cbe72c580c2fb2fa7 Mon Sep 17 00:00:00 2001
From: Fredrik Jonsson <frjo@xdeb.org>
Date: Thu, 27 Sep 2018 13:08:36 +0200
Subject: [PATCH] Update circleci config for gulp, now it works.

---
 .circleci/config.yml      | 47 +++++++++++++++++----------------------
 opentech/settings/test.py |  2 +-
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index e778f1694..b4db855af 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -5,9 +5,6 @@
 version: 2
 jobs:
   build:
-    branches:
-      only:
-        - heroku
     docker:
       - image: circleci/python:3.6.6-stretch-node
         environment:
@@ -27,59 +24,57 @@ jobs:
     steps:
       - checkout
 
-      # Download and cache dependencies
+      - run:
+          name: set owner on /usr/local
+          command: sudo chown -R circleci:circleci /usr/local
+
       - restore_cache:
           keys:
-            - v1-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
-            - v1-python-{{ .Branch }}-
-            - v1-python-
-
+            - v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
+            - v2-python-{{ .Branch }}-
+            - v2-python-
 
       - restore_cache:
           keys:
-            - v1-yarn-{{ .Branch }}-{{ checksum "package-lock.json" }}
-            - v1-yarn-{{ .Branch }}-
-            - v1-yarn-
+            - v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
+            - v2-npm-{{ .Branch }}-
+            - v2-npm-
 
       - run:
-          name: install dependencies
+          name: install python dependencies
           command: |
             python3 -m venv venv
             . venv/bin/activate
             pip install -r requirements.txt
 
       - run:
-          name: buils static assets
+          name: install node dependencies
           command: |
             npm install --quiet
             npm install -g gulp-cli
-            gulp deploy
 
       - save_cache:
           paths:
             - ./venv
-          key: v1-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
+          key: v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
 
       - save_cache:
           paths:
             - ./node_modules
-          key: v1-yarn-{{ .Branch }}-{{ checksum "opentech/static_src/yarn.lock" }}
+            - /usr/local/lib/node_modules
+            - /usr/local/bin
+          key: v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
+
+      - run:
+          name: buils static assets
+          command: gulp deploy
 
-      # run tests!
-      # this example uses Django's built-in test-runner
-      # other common Python testing frameworks include pytest and nose
-      # https://pytest.org
-      # https://nose.readthedocs.io
       - run:
           name: run tests
           command: |
             . venv/bin/activate
-            flake8
+            flake8 ./opentech
             python manage.py collectstatic --noinput --verbosity=0
             python manage.py check
             python manage.py makemigrations --check --noinput --verbosity=0
             python manage.py test
-
-      - store_artifacts:
-          path: test-reports
-          destination: test-reports
diff --git a/opentech/settings/test.py b/opentech/settings/test.py
index 89f1c83c9..e084affe8 100644
--- a/opentech/settings/test.py
+++ b/opentech/settings/test.py
@@ -1,4 +1,4 @@
-from .production import *  # noqa
+from .base import *  # noqa
 
 # Should only include explicit testing settings
 
-- 
GitLab