<commit_before>language: java
dist: trusty
#services:
  #- docker
jdk: oraclejdk8
sudo: required #to ensure we get a VM rather than a container for more memory and for all the apt-get stuff

env:
  DOCKER_COMPOSE_VERSION: 1.13.0
    
before_install:
    #Print out the current versions before we change them
  - docker --version
  - docker-compose --version
    #remove the old docker version
  - sudo apt-get -y remove docker docker-engine
    #extra stuff required for docker CE
  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    #Add the apt repo for docker
  - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  - sudo apt-get update
  - sudo apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates curl software-properties-common docker-ce
  - docker --version
    #remove the old docker-compose
  - sudo rm /usr/local/bin/docker-compose
  - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin
  - docker-compose --version


# We run a script to build dependencies and do database setup
#install: "./.travis.install.sh"
    
install: echo "skip 'gradle assemble' step to speed up build"

# Increase the size of the heap
before_script:
  - "echo $JAVA_OPTS"
  - "export JAVA_OPTS=-Xmx1024m"
  - "git clone https://github.com/gchq/urlDependencies-plugin.git"
  - "pushd urlDependencies-plugin"
  - "./gradlew clean build publishToMavenLocal"
  - "popd"
  - "git clone https://github.com/gchq/stroom-resources.git"
  - "pushd stroom-resources/dev-resources/compose"
    #start all the services we need to run the integration tests in stroom
  - "docker-compose -f hbase-kafka-mysql-zk.yml up -d"
  - "popd"


# We're running this as a script because our build is either too silent or too chatty and TravisCI will kill either way.
#script: travis_wait 30 ./gradlew -Pversion=$TRAVIS_TAG downloadUrlDependencies clean build -x test shadowJar
script: ./gradlew -Pversion=$TRAVIS_TAG downloadUrlDependencies clean build shadowJar

# Push to DockerHub. The username and password were added using the Travis CLI.
# The configuration below will only push an image if the branch being built is master.
after_success:
  - if [ "$TRAVIS_BRANCH" == "dev" ]; then
    docker login -u="$DOCKER_USERNAME" -p="$<PASSWORD>";
    docker build --tag=gchq/stroom:dev-latest stroom-app/. ;
    docker push gchq/stroom;
    fi

# Push to GitHub releases - the key was generated by the Travis CLI.
deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: stroom-app/build/libs/stroom-app-all.jar
  skip_cleanup: true
  on:
    tags: true

#clean out gradle caches as per travis docs
before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

# Cache dependencies to speed up the build
cache:
  directories:
    - .autoconf
    - $HOME/.m2
    - libs
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/<commit_msg>Add docker tagging logic to travis config, change to only start DBs<commit_after>language: java
dist: trusty
#services:
  #- docker
jdk: oraclejdk8
sudo: required #to ensure we get a VM rather than a container for more memory and for all the apt-get stuff

env:
  CURRENT_STROOM_DEV_VERSION: v6.0.0
  DOCKER_REPO: gchq/stroom
  DOCKER_COMPOSE_VERSION: 1.13.0
    
before_install:
    #Print out the current versions before we change them
  - docker --version
  - docker-compose --version
    #remove the old docker version
  - sudo apt-get -y remove docker docker-engine
    #extra stuff required for docker CE
  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    #Add the apt repo for docker
  - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  - sudo apt-get update
  - sudo apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates curl software-properties-common docker-ce
  - docker --version
    #remove the old docker-compose
  - sudo rm /usr/local/bin/docker-compose
  - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin
  - docker-compose --version


# We run a script to build dependencies and do database setup
#install: "./.travis.install.sh"
    
install: echo "skip 'gradle assemble' step to speed up build"

# Increase the size of the heap
before_script:
  - "echo $JAVA_OPTS"
  - "export JAVA_OPTS=-Xmx1024m"
  - "git clone https://github.com/gchq/urlDependencies-plugin.git"
  - "pushd urlDependencies-plugin"
  - "./gradlew clean build publishToMavenLocal"
  - "popd"
  - "git clone https://github.com/gchq/stroom-resources.git"
  - "pushd stroom-resources/dev-resources/compose"
    #start all the services we need to run the integration tests in stroom
  - "docker-compose -f stroom-dbs.yml up -d"
  - "popd"


# We're running this as a script because our build is either too silent or too chatty and TravisCI will kill either way.
#script: travis_wait 30 ./gradlew -Pversion=$TRAVIS_TAG downloadUrlDependencies clean build -x test shadowJar
script: ./gradlew -Pversion=$TRAVIS_TAG downloadUrlDependencies clean build shadowJar

# Push to DockerHub. The username and password were added using the Travis CLI.
# The configuration below will only push an image if the branch being built is master.
after_success:
  - export DATE_ONLY=$(date +%y%m%d)
  - export DATE_TIME=$(date +%y%m%d%H%M%S)
    #establish what version of stroom we are building
  - if [ -n "$TRAVIS_TAG" ]; then
      #this is a tagged build so use the tag as the version
      export STROOM_VERSION=${TRAVIS_TAG};
    else
      export STROOM_VERSION=${CURRENT_STROOM_DEV_VERSION};
    fi
  - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then
      export SPECIFIC_TAG="--tag=${DOCKER_REPO}:${STROOM_VERSION}-${DATE_ONLY}-DAILY";
      export FLOATING_TAG="";
    elif [ -n "$TRAVIS_TAG" ]; then
      export SPECIFIC_TAG="--tag=${DOCKER_REPO}:${TRAVIS_TAG}";
      export FLOATING_TAG="";
    elif [ "$TRAVIS_BRANCH" == "dev" ]; then
      export SPECIFIC_TAG="";
      export FLOATING_TAG="--tag=${DOCKER_REPO}:${STROOM_VERSION}-SNAPSHOT";
    fi
  - if [ -n "$TRAVIS_BRANCH" == "dev" || -n "$TRAVIS_TAG" || "$TRAVIS_EVENT_TYPE" == "cron" ]; then
      docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
      docker build ${SPECIFIC_TAG} ${FLOATING_TAG} stroom-app/. ;
      #docker build --tag=gchq/stroom:dev-latest stroom-app/. ;
      docker push gchq/stroom;
    fi

# Push to GitHub releases for any tagged commit - the key was generated by the Travis CLI.
deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: stroom-app/build/libs/stroom-app-all.jar
  skip_cleanup: true
  on:
    tags: true

#clean out gradle caches as per travis docs
before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

# Cache dependencies to speed up the build
cache:
  directories:
    - .autoconf
    - $HOME/.m2
    - libs
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
{'fraction_non_alphanumeric': 0.11310084825636192, 'fraction_numerical': 0.00471253534401508, 'mean_word_length': 3.3694117647058826, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '164583', 'n_tokens_mistral': 2647, 'n_tokens_neox': 2462, 'n_words': 747}