<commit_before>version: 2
jobs:
  build:
    working_directory: ~/repo
    docker:
      - image: circleci/node:8.12.0
      - image: microsoft/mssql-server-linux:2017-latest
        ports:
          - '1433:1433'
        environment:
          MSSQL_PID: developer
          ACCEPT_EULA: Y
          SA_PASSWORD: <PASSWORD>!
    steps:
      - setup_remote_docker
      - checkout
      - run:
          name: authorize npm
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: run npm install
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
          - ./node_modules
      - run: mkdir ~/junit
      - run:
          name: copy .env
          command: cp .example.env .env
          when: always
      - run:
          name: wait for mssql to respond
          command: |
            COUNTER=0
            while [ $COUNTER -lt 10 ]; do
              let COUNTER=COUNTER+1
              if nc -z 127.0.0.1 1433; then
                echo mssql listening
                break;
              fi
              echo waiting for mssql
              sleep 2;
            done;
          when: always
      - run:
          name: build & test
          command: npm run ci
          when: always
      - run:
          name: run all examples
          command: |
            set -ex
            for filename in examples/*.js; do
              [ -e "$filename" ] || continue
              DEBUG=mssq* node $filename
            done
      - run: cp test-report.xml ~/junit/test-results.xml
      - store_test_results:
          path: ~/junit
      - store_artifacts:
          path: ~/junit

  build_deploy_npm:
    working_directory: ~/repo
    docker:
      - image: circleci/node:8.12.0
    steps:
      - setup_remote_docker
      - checkout
      - run:
          name: authorize npm
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: run npm install
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
          - ./node_modules
      - run:
         name: Install Docker Compose
         command: |
           curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
           chmod +x ~/docker-compose
           sudo mv ~/docker-compose /usr/local/bin/docker-compose
      - run: mkdir ~/junit
      - run:
          name: start environment
          command: npm run devup
          when: always
      - run:
          name: copy .env
          command: cp .example.env .env
          when: always
      - run:
          name: wait for mssql to respond
          command: |
            COUNTER=0
            while [ $COUNTER -lt 10 ]; do
              let COUNTER=COUNTER+1
              if nc -z 127.0.0.1 1433; then
                echo mssql listening
                break;
              fi
              echo waiting for mssql
              sleep 2;
            done;
          when: always
      - run:
          name: build & test
          command: npm run ci
          when: always
      - run:
          name: run all examples
          command: |
            set -ex
            for filename in examples/*.js; do
              [ -e "$filename" ] || continue
              DEBUG=mssq* node $filename
            done
      - run: cp test-results.xml ~/junit/test-results.xml
      - store_test_results:
          path: ~/junit
      - store_artifacts:
          path: ~/junit
      - run:
          name: publish package to npm
          command: npm publish

workflows:
  version: 2
  build_deploy:
    jobs:
      - build:
          context: secrets
      - build_deploy_npm:
          context: secrets
          filters:
            tags:
              only: /.*/
            branches:
              ignore: /.*/
<commit_msg>release build<commit_after>version: 2
jobs:
  build:
    working_directory: ~/repo
    docker:
      - image: circleci/node:8.12.0
      - image: microsoft/mssql-server-linux:2017-latest
        ports:
          - '1433:1433'
        environment:
          MSSQL_PID: developer
          ACCEPT_EULA: Y
          SA_PASSWORD: <PASSWORD>!
    steps:
      - setup_remote_docker
      - checkout
      - run:
          name: authorize npm
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: run npm install
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
          - ./node_modules
      - run: mkdir ~/junit
      - run:
          name: copy .env
          command: cp .example.env .env
          when: always
      - run:
          name: wait for mssql to respond
          command: |
            COUNTER=0
            while [ $COUNTER -lt 10 ]; do
              let COUNTER=COUNTER+1
              if nc -z 127.0.0.1 1433; then
                echo mssql listening
                break;
              fi
              echo waiting for mssql
              sleep 2;
            done;
          when: always
      - run:
          name: build & test
          command: npm run ci
          when: always
      - run:
          name: run all examples
          command: |
            set -ex
            for filename in examples/*.js; do
              [ -e "$filename" ] || continue
              DEBUG=mssq* node $filename
            done
      - run: cp test-report.xml ~/junit/test-results.xml
      - store_test_results:
          path: ~/junit
      - store_artifacts:
          path: ~/junit

  build_deploy_npm:
    working_directory: ~/repo
    docker:
      - image: circleci/node:8.12.0
      - image: microsoft/mssql-server-linux:2017-latest
        ports:
          - '1433:1433'
        environment:
          MSSQL_PID: developer
          ACCEPT_EULA: Y
          SA_PASSWORD: <PASSWORD>!
    steps:
      - setup_remote_docker
      - checkout
      - run:
          name: authorize npm
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: run npm install
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
          - ./node_modules
      - run: mkdir ~/junit
      - run:
          name: copy .env
          command: cp .example.env .env
          when: always
      - run:
          name: wait for mssql to respond
          command: |
            COUNTER=0
            while [ $COUNTER -lt 10 ]; do
              let COUNTER=COUNTER+1
              if nc -z 127.0.0.1 1433; then
                echo mssql listening
                break;
              fi
              echo waiting for mssql
              sleep 2;
            done;
          when: always
      - run:
          name: build & test
          command: npm run ci
          when: always
      - run:
          name: run all examples
          command: |
            set -ex
            for filename in examples/*.js; do
              [ -e "$filename" ] || continue
              DEBUG=mssq* node $filename
            done
      - run: cp test-report.xml ~/junit/test-results.xml
      - store_test_results:
          path: ~/junit
      - store_artifacts:
          path: ~/junit
      - run:
          name: publish package to npm
          command: npm publish

workflows:
  version: 2
  build_deploy:
    jobs:
      - build:
          context: secrets
      - build_deploy_npm:
          context: secrets
          filters:
            tags:
              only: /.*/
            branches:
              ignore: /.*/

{'fraction_non_alphanumeric': 0.0928597854236034, 'fraction_numerical': 0.014798372179060304, 'mean_word_length': 1.2225267196492189, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3264380', 'n_tokens_mistral': 2465, 'n_tokens_neox': 2313, 'n_words': 623}