version: 2
jobs:
  build:
    docker:
      # this is a debian based image but this shouldn't be a problem.
      - image: circleci/python:2.7-stretch

    working_directory: ~/repo

    steps:
      - checkout
      - run: git submodule sync
      - run: git submodule update --init
        # install some required packages for building ubuntu packages
      - run: sudo -u root apt-get install build-essential python-setuptools python-all devscripts lsb-release

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "requirements.txt" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      # Setup the Virtualenv for building/installing privacyidea
      # We won't use requirements.txt here since we build using setup.py
      - run:
          name: install dependencies
          command: |
            virtualenv venv
            . venv/bin/activate
            pip install sphinx mock sphinxcontrib-httpdomain

      - save_cache:
          paths:
            - ./venv
          key: v1-dependencies-{{ checksum "requirements.txt" }}

      # run builds (currently no tests in CircleCI)
      - run:
          name: run setup.py build
          command: |
            . venv/bin/activate
            python setup.py install
            make builddeb-nosign

      - run:
          name: run ubuntu package build
          command: |
            . venv/bin/activate
            make builddeb-nosign

version: 2
jobs:
  build:
    docker:
      # this is a debian based image but this shouldn't be a problem.
      - image: circleci/python:2.7-stretch

    working_directory: ~/repo

    steps:
      - checkout
      - run: git submodule sync
      - run: git submodule update --init
        # install some required packages for building ubuntu packages
      - run: sudo -u root apt-get install build-essential python-setuptools python-all devscripts lsb-release

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "requirements.txt" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      # Setup the Virtualenv for building/installing privacyidea
      # We won't use requirements.txt here since we build using setup.py
      - run:
          name: install dependencies
          command: |
            virtualenv venv
            . venv/bin/activate
            pip install sphinx mock sphinxcontrib-httpdomain

      - save_cache:
          paths:
            - ./venv
          key: v1-dependencies-{{ checksum "requirements.txt" }}

      # run builds (currently no tests in CircleCI)
      - run:
          name: run setup.py build
          command: |
            . venv/bin/activate
            python setup.py build

Remove ubuntu build from circleci
Remove ubuntu build from circleci
