<commit_before>#
#  Globality autogenerated CircleCI configuration
#
#  This file is auto generated with globality-build.
#  You should not make any changes to this file manually
#
#  Any changes made to this file will be overwritten in the
#  next version of the build.
#
#  See: http://github.com/globality-corp/globality-buid
#
#

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: ${AWS_ECR_DOMAIN}/globality-build:stable
      aws_auth:
        aws_access_key_id: ${AWS_ACCESS_KEY_ID}
        aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
      environment:
        EXTRA_INDEX_URL: "InjectedDuringRuntime"
        AWS_ECR_DOMAIN: "InjectedDuringRuntime"
        JFROG_AUTH: "InjectedDuringRuntime"
        PYPI_USERNAME: "InjectedDuringRuntime"
        PYPI_PASSWORD: "<PASSWORD>"

deploy_defaults: &deploy_defaults
  working_directory: ~/repo
  docker:
    - image: ${AWS_ECR_DOMAIN}/globality-build:stable
      aws_auth:
        aws_access_key_id: ${AWS_ACCESS_KEY_ID}
        aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
      environment:
        EXTRA_INDEX_URL: "InjectedDuringRuntime"
        AWS_ECR_DOMAIN: "InjectedDuringRuntime"
        JFROG_AUTH: "InjectedDuringRuntime"
        PYPI_USERNAME: "InjectedDuringRuntime"
        PYPI_PASSWORD: "<PASSWORD>"

whitelist: &whitelist
  paths:
    .

version: 2

jobs:
  checkout:
    <<: *defaults

    steps:
      - checkout

      - persist_to_workspace:
          root: ~/repo
          <<: *whitelist

  build_base_docker:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: Build Base Docker
          # install dependencies for loading ecs task definitions
          command: |
            eval $(aws ecr get-login --no-include-email)
            python -m middlefield globality build build-gen --config .globality/build.json
            python -m middlefield globality build docker-base --repo microcosm-elasticsearch
            python -m middlefield globality build docker --repo microcosm-elasticsearch

  test:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: pull and run Elasticsearch
          command: |
            docker pull docker.elastic.co/elasticsearch/elasticsearch:5.3.1
            docker run -d --name elasticsearch -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -p 9200:9200 -e bootstrap.memory_lock=true -e cluster.name=docker -e http.host=0.0.0.0 -e transport.host=127.0.0.1 docker.elastic.co/elasticsearch/elasticsearch:5.3.1
      - run:
          name: Test code
          command: |
            docker create -v /src/microcosm_elasticsearch/tests/ --name service_tests alpine:3.4 /bin/true
            docker cp $(pwd)/microcosm_elasticsearch/tests service_tests:/src/microcosm_elasticsearch/
            eval $(aws ecr get-login --no-include-email)
            docker pull ${AWS_ECR_DOMAIN}/microcosm-elasticsearch:${CIRCLE_SHA1}
            docker run -it  --link elasticsearch:elasticsearch -e EXAMPLE__ELASTICSEARCH_CLIENT__HOST=elasticsearch --volumes-from service_tests ${AWS_ECR_DOMAIN}/microcosm-elasticsearch:${CIRCLE_SHA1} test

  lint:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: Run Lint
          command: |
            docker create -v /src/microcosm-elasticsearch/tests/ --name service_tests alpine:3.4 /bin/true
            docker cp $(pwd)/microcosm_elasticsearch/tests service_tests:/src/microcosm_elasticsearch/
            eval $(aws ecr get-login --no-include-email)
            docker pull ${AWS_ECR_DOMAIN}/microcosm-elasticsearch:${CIRCLE_SHA1}
            docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/microcosm-elasticsearch:${CIRCLE_SHA1} lint


  deploy:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: Deploy
          command: |
            echo "[distutils]" > ~/.pypirc
            echo "index-servers =" >> ~/.pypirc
            echo "    pypi" >> ~/.pypirc
            echo >> ~/.pypirc
            echo "[pypi]" >> ~/.pypirc
            echo "username:$PYPI_USERNAME" >> ~/.pypirc
            echo "password:$PYPI_PASSWORD" >> ~/.pypirc
            echo >> ~/.pypirc
            python setup.py register -r pypi
            python setup.py sdist upload -r pypi

workflows:
  version: 2

  build-and-release:
    jobs:
      - checkout:
          filters:
            # run for all branches and tags
            tags:
              only: /.*/<commit_msg>GLOB-21814: Use same repo for all open source libraries (#30)<commit_after>#
#  Globality autogenerated CircleCI configuration
#
#  This file is auto generated with globality-build.
#  You should not make any changes to this file manually
#
#  Any changes made to this file will be overwritten in the
#  next version of the build.
#
#  See: http://github.com/globality-corp/globality-buid
#
#

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: ${AWS_ECR_DOMAIN}/globality-build:stable
      aws_auth:
        aws_access_key_id: ${AWS_ACCESS_KEY_ID}
        aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
      environment:
        EXTRA_INDEX_URL: "InjectedDuringRuntime"
        AWS_ECR_DOMAIN: "InjectedDuringRuntime"
        JFROG_AUTH: "InjectedDuringRuntime"
        PYPI_USERNAME: "InjectedDuringRuntime"
        PYPI_PASSWORD: "<PASSWORD>"

deploy_defaults: &deploy_defaults
  working_directory: ~/repo
  docker:
    - image: ${AWS_ECR_DOMAIN}/globality-build:stable
      aws_auth:
        aws_access_key_id: ${AWS_ACCESS_KEY_ID}
        aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
      environment:
        EXTRA_INDEX_URL: "InjectedDuringRuntime"
        AWS_ECR_DOMAIN: "InjectedDuringRuntime"
        JFROG_AUTH: "InjectedDuringRuntime"
        PYPI_USERNAME: "InjectedDuringRuntime"
        PYPI_PASSWORD: "<PASSWORD>"

whitelist: &whitelist
  paths:
    .

version: 2

jobs:
  checkout:
    <<: *defaults

    steps:
      - checkout

      - persist_to_workspace:
          root: ~/repo
          <<: *whitelist

  build_base_docker:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: Build Base Docker
          # install dependencies for loading ecs task definitions
          command: |
            eval $(aws ecr get-login --no-include-email)
            python -m middlefield globality build build-gen --config .globality/build.json
            python -m middlefield globality build docker-base --repo python-library
            python -m middlefield globality build docker --repo python-library

  test:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: pull and run Elasticsearch
          command: |
            docker pull docker.elastic.co/elasticsearch/elasticsearch:5.3.1
            docker run -d --name elasticsearch -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -p 9200:9200 -e bootstrap.memory_lock=true -e cluster.name=docker -e http.host=0.0.0.0 -e transport.host=127.0.0.1 docker.elastic.co/elasticsearch/elasticsearch:5.3.1
      - run:
          name: Test code
          command: |
            docker create -v /src/microcosm_elasticsearch/tests/ --name service_tests alpine:3.4 /bin/true
            docker cp $(pwd)/microcosm_elasticsearch/tests service_tests:/src/microcosm_elasticsearch/
            eval $(aws ecr get-login --no-include-email)
            docker pull ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1}
            docker run -it  --link elasticsearch:elasticsearch -e EXAMPLE__ELASTICSEARCH_CLIENT__HOST=elasticsearch --volumes-from service_tests ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1} test

  lint:
    <<: *defaults

    steps:
      - attach_workspace:
          at: ~/repo

      - setup_remote_docker

      - run:
          name: Run Lint
          command: |
            docker create -v /src/microcosm-elasticsearch/tests/ --name service_tests alpine:3.4 /bin/true
            docker cp $(pwd)/microcosm_elasticsearch/tests service_tests:/src/microcosm_elasticsearch/
            eval $(aws ecr get-login --no-include-email)
            docker pull ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1}
            docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1} lint


  deploy:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: Deploy
          command: |
            echo "[distutils]" > ~/.pypirc
            echo "index-servers =" >> ~/.pypirc
            echo "    pypi" >> ~/.pypirc
            echo >> ~/.pypirc
            echo "[pypi]" >> ~/.pypirc
            echo "username:$PYPI_USERNAME" >> ~/.pypirc
            echo "password:$<PASSWORD>" >> ~/.pypirc
            echo >> ~/.pypirc
            python setup.py register -r pypi
            python setup.py sdist upload -r pypi

workflows:
  version: 2

  build-and-release:
    jobs:
      - checkout:
          filters:
            # run for all branches and tags
            tags:
              only: /.*/
{'fraction_non_alphanumeric': 0.09966526293056906, 'fraction_numerical': 0.009394233884029803, 'mean_word_length': 2.2532490340709517, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5731250', 'n_tokens_mistral': 3078, 'n_tokens_neox': 2896, 'n_words': 645}