<commit_before>version: 2.1
orbs:
  hubploy:
    jobs:
      build-image:
        description: "Build an image via hubploy"
        parameters:
          deployment:
            type: string
          push:
            type: boolean
            default: false

        docker:
          - image: python:3.7-slim-buster
        working_directory: ~/repo
        steps:
          - checkout
          - run:
              name: Install git & curl
              command: |
                apt-get update && apt-get install --yes --no-install-recommends git curl
          - restore_cache:
              keys:
                - v3.7-dependencies-{{ checksum "requirements.txt" }}
                # fallback to using the latest cache if no exact match is found
                - v3.7-dependencies-

          - run:
              name: install dependencies
              command: |
                python3 -m venv venv
                source venv/bin/activate
                pip install --upgrade -r requirements.txt
                # Install latest repo2docker to https://github.com/jupyter/repo2docker/pull/657
                pip install --upgrade git+https://github.com/jupyter/repo2docker@e976627c1e238cf654ad178456b1bf81db7aac36
                echo 'export PATH="${HOME}/repo/venv/bin:$PATH"' >> ${BASH_ENV}

          - when:
              condition: << parameters.push >>
              # Currently all our images live on google cloud, so we install gcloud sdk when pushing
              steps:
              - run:
                  name: Install google cloud sdk
                  command: |
                    curl -sSL  https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-226.0.0-linux-x86_64.tar.gz | tar -xzf -
                    # Be careful with quote ordering here. ${PATH} must not be expanded<commit_msg>Install git-crypt in image builder<commit_after>version: 2.1
orbs:
  hubploy:
    jobs:
      build-image:
        description: "Build an image via hubploy"
        parameters:
          deployment:
            type: string
          push:
            type: boolean
            default: false

        docker:
          - image: python:3.7-slim-buster
        working_directory: ~/repo
        steps:
          - checkout
          - run:
              name: Install git, git-crypt & curl
              command: |
                apt-get update && apt-get install --yes --no-install-recommends git curl git-crypt
          - restore_cache:
              keys:
                - v3.7-dependencies-{{ checksum "requirements.txt" }}
                # fallback to using the latest cache if no exact match is found
                - v3.7-dependencies-

          - run:
              name: install dependencies
              command: |
                python3 -m venv venv
                source venv/bin/activate
                pip install --upgrade -r requirements.txt
                # Install latest repo2docker to https://github.com/jupyter/repo2docker/pull/657
                pip install --upgrade git+https://github.com/jupyter/repo2docker@e976627c1e238cf654ad178456b1bf81db7aac36
                echo 'export PATH="${HOME}/repo/venv/bin:$PATH"' >> ${BASH_ENV}

          - when:
              condition: << parameters.push >>
              # Currently all our images live on google cloud, so we install gcloud sdk when pushing
              steps:
              - run:
                  name: Install google cloud sdk
                  command: |
                    curl -sSL  https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-226.0.0-linux-x86_64.tar.gz | tar -xzf -
                    # Be careful with quote ordering here. ${PATH} must not be expanded
{'fraction_non_alphanumeric': 0.08681672025723473, 'fraction_numerical': 0.026259378349410504, 'mean_word_length': 1.4208819714656291, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1262860', 'n_tokens_mistral': 1077, 'n_tokens_neox': 977, 'n_words': 267}