Skip to content
Snippets Groups Projects
config.yml 2.12 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Python CircleCI 2.0 configuration file
    #
    # Check https://circleci.com/docs/2.0/language-python/ for more details
    #
    version: 2
    jobs:
      build:
        docker:
          - image: circleci/python:3.6.6-stretch-node
            environment:
              DATABASE_URL: postgresql://root@localhost/opentech?sslmode=disable
              PGHOST: localhost
              PGUSER: root
    
              DJANGO_SETTINGS_MODULE: opentech.settings.test
    
              SEND_MESSAGES: false
    
          - image: circleci/postgres:10.5
            environment:
              POSTGRES_USER: root
              POSTGRES_DB: opentech
    
        working_directory: ~/repo
    
        steps:
          - checkout
    
    
          - run:
              name: set owner on /usr/local
              command: sudo chown -R circleci:circleci /usr/local
    
    
                - v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
                - v2-python-{{ .Branch }}-
                - v2-python-
    
                - v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
                - v2-npm-{{ .Branch }}-
                - v2-npm-
    
              name: install python dependencies
    
              command: |
                python3 -m venv venv
                . venv/bin/activate
                pip install -r requirements.txt
    
          - run:
    
              name: install node dependencies
    
                npm install --quiet
                npm install -g gulp-cli
    
              key: v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
    
                - /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:
              name: run tests
              command: |
                . venv/bin/activate
    
                python manage.py collectstatic --noinput --verbosity=0
                python manage.py check
                python manage.py makemigrations --check --noinput --verbosity=0