<commit_before>sudo: required

env:
  - VERSION=9.3
  - VERSION=9.4
  - VERSION=9.5

services:
  - docker

before_install:
  - sudo apt-get -y install python-pip
  - sudo pip install docker-squash
  - docker build -t nanobox/postgresql:$VERSION ./$VERSION

script: sudo test/run_all.sh $VERSION

after_success:
  - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
  - "echo \"Branch: '$BRANCH'; Version: '$VERSION'\";"
  - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
  - docker build -t ${NAMESPACE}/postgresql ./${VERSION};
  - docker-squash -t ${NAMESPACE}/postgresql:squashed -f nanobox/runit --tmp-dir /var/tmp/squasher ${NAMESPACE}/postgresql
  # `$VERSION-beta` tag is always pushed (master or any dev branch)
  - docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION}-beta;
  - docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION}-beta;
  # `beta` tag is always pushed (master or any dev branch)
  - if [ "$VERSION" == "9.5" ]; then
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:beta;
    docker push ${REMOTE}${NAMESPACE}/postgresql:beta;
    fi
  # `latest` tag is only pushed on master && most recent version
  - if [ "$BRANCH" == "master" ] && [ "$VERSION" == "9.5" ]; then
    docker push ${REMOTE}${NAMESPACE}/postgresql;
    fi
  # `$VERSION` (latest/stable implied) tag is only pushed on master. tag branch for clarity otherwise (`$VERSION-$BRANCH`)
  - if [ "$BRANCH" == "master" ]; then
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION};
    docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION};
    else
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION}-${BRANCH//\//_};
    docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION}-${BRANCH//\//_};
    fi<commit_msg>make sure docker tags are set before docker push<commit_after>sudo: required

env:
  - VERSION=9.3
  - VERSION=9.4
  - VERSION=9.5

services:
  - docker

before_install:
  - sudo apt-get -y install python-pip
  - sudo pip install docker-squash
  - docker build -t nanobox/postgresql:$VERSION ./$VERSION

script: sudo test/run_all.sh $VERSION

after_success:
  - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
  - "echo \"Branch: '$BRANCH'; Version: '$VERSION'\";"
  - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
  - docker build -t ${NAMESPACE}/postgresql ./${VERSION};
  - docker-squash -t ${NAMESPACE}/postgresql:squashed -f nanobox/runit --tmp-dir /var/tmp/squasher ${NAMESPACE}/postgresql
  # `$VERSION-beta` tag is always pushed (master or any dev branch)
  - docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION}-beta;
  - docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION}-beta;
  # `beta` tag is always pushed (master or any dev branch)
  - if [ "$VERSION" == "9.5" ]; then
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:beta;
    docker push ${REMOTE}${NAMESPACE}/postgresql:beta;
    fi
  # `latest` tag is only pushed on master && most recent version
  - if [ "$BRANCH" == "master" ] && [ "$VERSION" == "9.5" ]; then
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql;
    docker push ${REMOTE}${NAMESPACE}/postgresql;
    fi
  # `$VERSION` (latest/stable implied) tag is only pushed on master. tag branch for clarity otherwise (`$VERSION-$BRANCH`)
  - if [ "$BRANCH" == "master" ]; then
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION};
    docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION};
    else
    docker tag ${NAMESPACE}/postgresql:squashed ${NAMESPACE}/postgresql:${VERSION}-${BRANCH//\//_};
    docker push ${REMOTE}${NAMESPACE}/postgresql:${VERSION}-${BRANCH//\//_};
    fi
{'fraction_non_alphanumeric': 0.1675204918032787, 'fraction_numerical': 0.005122950819672131, 'mean_word_length': 4.199733688415446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1585956', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1374, 'n_words': 321}