<commit_before>defaults: &defaults
  working_directory: ~/dollar
  docker:
    - image: sillelien/circleci-dollar-build-image
    - image: redis:3-alpine

  environment:
    MAJOR_VERSION: 0.3
    MAVEN_OPTS: "-Xmx1g -DbuildNumber=${CIRCLE_BUILD_NUM} -Dorg.xml.sax.driver='com.sun.org.apache.xerces.internal.parsers.SAXParser' "
    TZ: "/usr/share/zoneinfo/Europe/London"
  branches:
    ignore:
      - gh-pages


version: 2
jobs:
    build:
      <<: *defaults

      steps:

        - checkout

        - restore_cache:
            key: dependency-cache

        - run:
            name: dependencies
            command: ~/build-utils/maven_make_deps.sh

        - save_cache:
            key: dependency-cache
            paths:
                - ~/.m2
        - run:
            name: test
            command: ./build.sh

            no_output_timeout: 600

    promote:
      <<: *defaults

      steps:
        - checkout
        - run:
            name: promote
            command: ~/build-utils/promote_from_staging.sh

    maven-deploy:
      <<: *defaults

      steps:

        - checkout

        - restore_cache:
            key: dependency-cache

        - run:
            name: deploy
            command: ./deploy-maven.sh

        - save_cache:
            key: dependency-cache
            paths:
                - ~/.m2


    docs:
      <<: *defaults
      docker:
        - image: jekyll/builder

      steps:

        - run:
            name: build-docs
            command: |
              set -x
              cd /srv/jekyll
              git clone https://github.com/sillelien/dollar project
              cd project
              git checkout $CIRCLE_BRANCH
              cd ..
              mkdir -p dist
              cd dist
              git clone https://github.com/sillelien/dollar docs
              cd docs
              git checkout gh-pages
              ls ~/project/dollar-docs/src/main/webapp/
              sudo jekyll build --source ~/project/dollar-docs/src/main/webapp/ --destination ~/dist/docs
              git add *
              git commit -a -m "Updated docs from build"  || :
              git push || :<commit_msg>GitHub API changes<commit_after>defaults: &defaults
  working_directory: ~/dollar
  docker:
    - image: sillelien/circleci-dollar-build-image
    - image: redis:3-alpine

  environment:
    MAJOR_VERSION: 0.3
    MAVEN_OPTS: "-Xmx1g -DbuildNumber=${CIRCLE_BUILD_NUM} -Dorg.xml.sax.driver='com.sun.org.apache.xerces.internal.parsers.SAXParser' "
    TZ: "/usr/share/zoneinfo/Europe/London"
  branches:
    ignore:
      - gh-pages


version: 2
jobs:
    build:
      <<: *defaults

      steps:

        - checkout

        - restore_cache:
            key: dependency-cache

        - run:
            name: dependencies
            command: ~/build-utils/maven_make_deps.sh

        - save_cache:
            key: dependency-cache
            paths:
                - ~/.m2
        - run:
            name: test
            command: ./build.sh

            no_output_timeout: 600

    promote:
      <<: *defaults

      steps:
        - checkout
        - run:
            name: promote
            command: ~/build-utils/promote_from_staging.sh

    maven-deploy:
      <<: *defaults

      steps:

        - checkout

        - restore_cache:
            key: dependency-cache

        - run:
            name: deploy
            command: ./deploy-maven.sh

        - save_cache:
            key: dependency-cache
            paths:
                - ~/.m2


    docs:
      <<: *defaults
      docker:
        - image: jekyll/builder

      steps:

        - run:
            name: build-docs
            command: |
              set -x
              cd /srv/jekyll
              git clone https://github.com/sillelien/dollar project
              cd project
              git checkout $CIRCLE_BRANCH
              cd ..
              mkdir -p dist
              cd dist
              git clone https://github.com/sillelien/dollar docs
              cd docs
              git checkout gh-pages
              jekyll build --source /srv/jekyll/project/dollar-docs/src/main/webapp/ --destination /srv/jekyll/dist/docs
              git add *
              git commit -a -m "Updated docs from build"  || :
              git push || :
{'fraction_non_alphanumeric': 0.09660938225731537, 'fraction_numerical': 0.004644681839294009, 'mean_word_length': 1.251437532671197, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, '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': '2806626', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1229, 'n_words': 265}