<commit_before>env:
  global:
    - secure: "<KEY>

language: java

jdk:
  - oraclejdk8

sudo: false

services:
  - docker

notifications:
    slack: nci-agency:TvRV22whtaRGflaCPPfv2G1v

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.sonar/cache
    - client/node_modules

before_install:
  - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-  
  - echo "run.environment(\"DB_DRIVER\", \"sqlserver\")" > localSettings.gradle
  - echo "run.environment(\"ANET_SA_PASSWORD\", \"<PASSWORD>\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_SERVER\", \"localhost\")"  >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_NAME\", \"testAnet\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_USERNAME\", \"anetUser\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_PASSWORD\", \"<PASSWORD>\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_PORT\", 1433)" >> localSettings.gradle
  - ./gradlew dockerCreateDB dockerStartDB

#By default travis runs gradle assemble in install. This is too early as we don't want to build yet
install:
  - ./gradlew npmInstall

script:
  - docker exec -ti -e "DB_NAME=testAnet" -e "DB_USER=anetUser" -e "DB_USER_PASSWORD=<PASSWORD>" anet-mssql-server /opt/waitTillServiceStarted.sh
  - ./gradlew dbMigrate dockerLoadDB
  - ./gradlew check sonarqube

after_script:
  - docker logs anet-mssql-server

addons:
  srcclr: true
  coverity_scan:
    project:
      name: "NCI-Agency/anet"
    notification_email: <EMAIL>
    build_command_prepend: "./gradlew clean"
    build_command:   "./gradlew build -x test"
    branch_pattern: candidate_scan
  sonarcloud:
    organization: "nci-agency-github"
    token:
      secure: "<KEY>
    branches:
      - master<commit_msg>Make coverity look for JS files in client directory<commit_after>env:
  global:
    - secure: "<KEY>

language: java

jdk:
  - oraclejdk8

sudo: false

services:
  - docker

notifications:
    slack: nci-agency:TvRV22whtaRGflaCPPfv2G1v

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.sonar/cache
    - client/node_modules

before_install:
  - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-  
  - echo "run.environment(\"DB_DRIVER\", \"sqlserver\")" > localSettings.gradle
  - echo "run.environment(\"ANET_SA_PASSWORD\", \"SA-P@ssw0rd\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_SERVER\", \"localhost\")"  >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_NAME\", \"testAnet\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_USERNAME\", \"anetUser\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_PASSWORD\", \"Test-P@ssw0rd\")" >> localSettings.gradle
  - echo "run.environment(\"ANET_DB_PORT\", 1433)" >> localSettings.gradle
  - ./gradlew dockerCreateDB dockerStartDB

#By default travis runs gradle assemble in install. This is too early as we don't want to build yet
install:
  - ./gradlew npmInstall

script:
  - docker exec -ti -e "DB_NAME=testAnet" -e "DB_USER=anetUser" -e "DB_USER_PASSWORD=<PASSWORD>" anet-mssql-server /opt/waitTillServiceStarted.sh
  - ./gradlew dbMigrate dockerLoadDB
  - ./gradlew check sonarqube

after_script:
  - docker logs anet-mssql-server

addons:
  srcclr: true
  coverity_scan:
    project:
      name: "NCI-Agency/anet"
    notification_email: <EMAIL>
    build_command_prepend: "COV_BUILD_OPTIONS='--fs-capture-search src --fs-capture-search client' && ./gradlew clean"
    build_command:   "./gradlew build -x test"
    branch_pattern: candidate_scan
  sonarcloud:
    organization: "nci-agency-github"
    token:
      secure: "<KEY>
    branches:
      - master
{'fraction_non_alphanumeric': 0.14578313253012049, 'fraction_numerical': 0.007228915662650603, 'mean_word_length': 3.4065817409766455, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 39, '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': '1714579', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1496, 'n_words': 303}