<commit_before>sudo: required

services:
- docker

before_install:
- sudo apt-get -qq update
# upgrade docker, for build argument support
- sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine
- docker version
- docker ps -a
# get the current branch name
- sudo apt-get install jq
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- echo $PR
- echo $BRANCH
# try to check out the same branch for counterparty-lib (if it exists), and fallback to the develop branch if not
- if curl --output /dev/null --silent --head --fail "https://github.com/CounterpartyXCP/counterparty-cli/tree/$BRANCH"; then export DOCKERFILE_CLI_BRANCH="$BRANCH"; else export DOCKERFILE_CLI_BRANCH="develop"; fi
- echo $DOCKERFILE_CLI_BRANCH
# build docker image
- docker build -t counterparty/counterparty-server --build-arg CLI_BRANCH="$DOCKERFILE_CLI_BRANCH" .

script:
# run the test suite in the docker container we just made
- docker run --entrypoint=/bin/bash counterparty/counterparty-server -c "cd /counterparty-lib/counterpartylib; py.test --skiptestbook=all --cov-config=../.coveragerc --cov-report=term-missing --cov=./"

notifications:
  slack:
    secure: <KEY>

after_success:
- coveralls
# if it's master or develop, then push the appropirately tagged docker image (otherwise don't push anything)
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- if [ "$BRANCH" == "master" ]; then docker push counterparty/counterparty-server:latest; fi 
- if [ "$BRANCH" == "develop" ]; then docker push counterparty/counterparty-server:develop; fi 
<commit_msg>removed -e from `docker login`. no longer doing `docker login` when running for a PR.<commit_after>sudo: required

services:
- docker

before_install:
- sudo apt-get -qq update
# upgrade docker, for build argument support
- sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine
- docker version
- docker ps -a
# get the current branch name
- sudo apt-get install jq
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- echo $PR
- echo $BRANCH
# try to check out the same branch for counterparty-lib (if it exists), and fallback to the develop branch if not
- if curl --output /dev/null --silent --head --fail "https://github.com/CounterpartyXCP/counterparty-cli/tree/$BRANCH"; then export DOCKERFILE_CLI_BRANCH="$BRANCH"; else export DOCKERFILE_CLI_BRANCH="develop"; fi
- echo $DOCKERFILE_CLI_BRANCH
# build docker image
- docker build -t counterparty/counterparty-server --build-arg CLI_BRANCH="$DOCKERFILE_CLI_BRANCH" .

script:
# run the test suite in the docker container we just made
- docker run --entrypoint=/bin/bash counterparty/counterparty-server -c "cd /counterparty-lib/counterpartylib; py.test --skiptestbook=all --cov-config=../.coveragerc --cov-report=term-missing --cov=./"

notifications:
  slack:
    secure: <KEY>

after_success:
- coveralls
# if it's master or develop, then push the appropirately tagged docker image (otherwise don't push anything)
- |
  if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
    docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
    if [ "$BRANCH" == "master" ]; then docker push counterparty/counterparty-server:latest; fi
    if [ "$BRANCH" == "develop" ]; then docker push counterparty/counterparty-server:develop; fi
  fi
{'fraction_non_alphanumeric': 0.12927964941112025, 'fraction_numerical': 0.0, 'mean_word_length': 4.3391812865497075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '6380721', 'n_tokens_mistral': 1267, 'n_tokens_neox': 1211, 'n_words': 362}