version: 2
jobs:
  build:
    docker:
      - image: python:3.7-stretch
      
    working_directory: ~/repo

    steps:
      - checkout

      # 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-

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            source venv/bin/activate
            pip install -r requirements.txt

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

      - run:
          # GCR_READONLY_KEY is ok to leak publicly
          name: build-image
          command: |
            source venv/bin/activate
            hubploy-image-builder \
              --registry-url https://gcr.io \
              --registry-username _json_key \
              --registry-password "${GCR_READONLY_KEY}" \
              user-image/ gcr.io/ucb-datahub-2018/primary-user-image
            

version: 2
jobs:
  build:
    docker:
      - image: python:3.7-stretch
      
    working_directory: ~/repo

    steps:
      - checkout

      # 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-

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            source venv/bin/activate
            pip install --upgrade -r requirements.txt

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

      - run:
          # GCR_READONLY_KEY is ok to leak publicly
          name: build-image
          command: |
            source venv/bin/activate
            hubploy-image-builder \
              --registry-url https://gcr.io \
              --registry-username _json_key \
              --registry-password "${GCR_READONLY_KEY}" \
              user-image/ gcr.io/ucb-datahub-2018/primary-user-image
            

Upgrade pip based dependencies for each deploy
Upgrade pip based dependencies for each deploy

Now that hubploy is actively being developed
