<commit_before>dist: xenial
sudo: required
install: true  # skips unnecessary "gradle assemble" install step

services:
- docker
- postgresql

addons:
  postgresql: "11"
  sonarcloud:
    organization: "napstr-github"

env:
  global:
    - BUILD_NUMBER: "$TRAVIS_BUILD_NUMBER"
    - BINTRAY_USER: napster
    - secure: "<KEY>
    - DOCKER_USERNAME: napstr
    - secure: "<KEY>

language: java

cache:
  directories:
    - "$HOME/.m2"
    - "$HOME/.gradle/wrapper"
    - "$HOME/.gradle/caches"
    - "$HOME/.sonar/cache"

jobs:
  include:
    - stage: build
      jdk: openjdk11
      before_script:
        - java -Xmx32m -version
        # to determine version
        - git fetch --unshallow
      script:
        - ./gradlew assemble --info

    - stage: sonar
      jdk: openjdk11
      before_script:
        - java -Xmx32m -version
        # for full sonar cloud blame information
        - git fetch --unshallow
      script:
        - ./gradlew sonarqube
        - IMAGE_TAG=$(echo ${TRAVIS_BRANCH} | sed -e 's/\//_/g')
        - CI_IMAGE_NAME=$DOCKER_USERNAME/wolfia:ci-$IMAGE_TAG
        - echo $CI_IMAGE_NAME
        - docker build -t "$CI_IMAGE_NAME" -f docker/Dockerfile .
      after_success:
        - echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
        - docker push $CI_IMAGE_NAME
        - docker logout

    - stage: publish
      jdk: openjdk11
      script:
        - ./gradlew bintrayUpload --info
        - IMAGE_TAG=$(echo ${TRAVIS_BRANCH} | sed -e 's/\//_/g')
        - CI_IMAGE_NAME=$DOCKER_USERNAME/wolfia:ci-$IMAGE_TAG
        - echo $CI_IMAGE_NAME
        - PUBLIC_IMAGE_NAME=$DOCKER_USERNAME/wolfia:$IMAGE_TAG
        - echo $PUBLIC_IMAGE_NAME
        - echo "$<PASSWORD>_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
        - docker pull $CI_IMAGE_NAME
        - docker tag $CI_IMAGE_NAME $PUBLIC_IMAGE_NAME
        - docker push $PUBLIC_IMAGE_NAME
        - docker logout

stages:
  - build
  - sonar
  - name: publish
    if: tag IS present<commit_msg>Rename sonar stage to test stage<commit_after>dist: xenial
sudo: required
install: true  # skips unnecessary "gradle assemble" install step

services:
- docker
- postgresql

addons:
  postgresql: "11"
  sonarcloud:
    organization: "napstr-github"

env:
  global:
    - BUILD_NUMBER: "$TRAVIS_BUILD_NUMBER"
    - BINTRAY_USER: napster
    - secure: "<KEY>
    - DOCKER_USERNAME: napstr
    - secure: "<KEY>

language: java

cache:
  directories:
    - "$HOME/.m2"
    - "$HOME/.gradle/wrapper"
    - "$HOME/.gradle/caches"
    - "$HOME/.sonar/cache"

jobs:
  include:
    - stage: build
      jdk: openjdk11
      before_script:
        - java -Xmx32m -version
        # to determine version
        - git fetch --unshallow
      script:
        - ./gradlew assemble --info

    - stage: test
      jdk: openjdk11
      before_script:
        - java -Xmx32m -version
        # for full sonar cloud blame information
        - git fetch --unshallow
      script:
        - ./gradlew sonarqube
        - IMAGE_TAG=$(echo ${TRAVIS_BRANCH} | sed -e 's/\//_/g')
        - CI_IMAGE_NAME=$DOCKER_USERNAME/wolfia:ci-$IMAGE_TAG
        - echo $CI_IMAGE_NAME
        - docker build -t "$CI_IMAGE_NAME" -f docker/Dockerfile .
      after_success:
        - echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
        - docker push $CI_IMAGE_NAME
        - docker logout

    - stage: publish
      jdk: openjdk11
      script:
        - ./gradlew bintrayUpload --info
        - IMAGE_TAG=$(echo ${TRAVIS_BRANCH} | sed -e 's/\//_/g')
        - CI_IMAGE_NAME=$DOCKER_USERNAME/wolfia:ci-$IMAGE_TAG
        - echo $CI_IMAGE_NAME
        - PUBLIC_IMAGE_NAME=$DOCKER_USERNAME/wolfia:$IMAGE_TAG
        - echo $PUBLIC_IMAGE_NAME
        - echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
        - docker pull $CI_IMAGE_NAME
        - docker tag $CI_IMAGE_NAME $PUBLIC_IMAGE_NAME
        - docker push $PUBLIC_IMAGE_NAME
        - docker logout

stages:
  - build
  - test
  - name: publish
    if: tag IS present
{'fraction_non_alphanumeric': 0.11151870873074102, 'fraction_numerical': 0.006358522866226461, 'mean_word_length': 2.1558641975308643, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '283435', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1400, 'n_words': 310}