<commit_before>general:
  branches:
    ignore:
      - gh\-pages
      - /pull\/.*/

machine:
  services:
    - docker
  environment:
    GOPATH: /home/ubuntu:$GOPATH
    SRCDIR: /home/ubuntu/src/github.com/weaveworks/weave
    PATH: $PATH:$HOME/.local/bin:$HOME/google-cloud-sdk/bin/
    CLOUDSDK_CORE_DISABLE_PROMPTS: 1
    WEAVE_TEST: $HOME/docker/weave-test.tar

dependencies:
  cache_directories:
    - "~/docker"
  override:
    - if [[ -e "$WEAVE_TEST" ]]; then
        docker load -i $WEAVE_TEST;
      else
        docker build -t weaveworks/weave-build build;
        docker build -t weaveworks/weave-test test/image;
        mkdir -p $(dirname "$WEAVE_TEST");
        docker save weaveworks/weave-test >$WEAVE_TEST;
      fi
  post:
    - sudo apt-get update && sudo apt-get install bc jq && pip install requests
    - curl https://sdk.cloud.google.com | bash
    - bin/setup-circleci-secrets "$SECRET_PASSWORD"
    - mkdir -p $(dirname $SRCDIR) && cp -r $(pwd)/ $SRCDIR
    - cd $SRCDIR/test; ./gce.sh make_template:
        parallel: false

test:
  override:
    - cd $SRCDIR; make lint:
        parallel: true
    - docker run -v /home/ubuntu:/home/go -e COVERDIR=test/coverage -e SLOW=true -e CIRCLECI -e CIRCLE_BUILD_NUM -e CIRCLE_NODE_TOTAL -e CIRCLE_NODE_INDEX weaveworks/weave-test:
        parallel: true
    - docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
        parallel: true
    - cd $SRCDIR/test; ./gce.sh setup && eval $(./gce.sh hosts) && ./setup.sh:
        parallel: true
    - cd $SRCDIR/test; eval $(./gce.sh hosts); ./run_all.sh:
        parallel: true
        timeout: 300
    - cd $SRCDIR; make clean-bin:
        parallel: true
    - docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
        parallel: true
  post:
    - cd $SRCDIR/test; ./gce.sh destroy:
        parallel: true

teardown:
  pre:
    - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; ./gen_coverage_reports.sh):
        parallel: true
    - test "$CIRCLE_NODE_INDEX" != "0" || (go get github.com/mattn/goveralls && goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/test/profile.cov -service=circleci || true):
        parallel: true
    - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; cp coverage.* $CIRCLE_ARTIFACTS):
        parallel: true

deployment:
  hub:
    branch: master
    owner: weaveworks
    commands:<commit_msg>Revert "Remove code coverage as temporary work-around to Docker 1.9 issue"<commit_after>general:
  branches:
    ignore:
      - gh\-pages
      - /pull\/.*/

machine:
  services:
    - docker
  environment:
    GOPATH: /home/ubuntu:$GOPATH
    SRCDIR: /home/ubuntu/src/github.com/weaveworks/weave
    PATH: $PATH:$HOME/.local/bin:$HOME/google-cloud-sdk/bin/
    CLOUDSDK_CORE_DISABLE_PROMPTS: 1
    WEAVE_TEST: $HOME/docker/weave-test.tar

dependencies:
  cache_directories:
    - "~/docker"
  override:
    - if [[ -e "$WEAVE_TEST" ]]; then
        docker load -i $WEAVE_TEST;
      else
        docker build -t weaveworks/weave-build build;
        docker build -t weaveworks/weave-test test/image;
        mkdir -p $(dirname "$WEAVE_TEST");
        docker save weaveworks/weave-test >$WEAVE_TEST;
      fi
  post:
    - sudo apt-get update && sudo apt-get install bc jq && pip install requests
    - curl https://sdk.cloud.google.com | bash
    - bin/setup-circleci-secrets "$SECRET_PASSWORD"
    - mkdir -p $(dirname $SRCDIR) && cp -r $(pwd)/ $SRCDIR
    - cd $SRCDIR/test; ./gce.sh make_template:
        parallel: false

test:
  override:
    - cd $SRCDIR; make lint:
        parallel: true
    - docker run -v /home/ubuntu:/home/go -e COVERDIR=test/coverage -e SLOW=true -e CIRCLECI -e CIRCLE_BUILD_NUM -e CIRCLE_NODE_TOTAL -e CIRCLE_NODE_INDEX weaveworks/weave-test:
        parallel: true
    - docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go -e COVERAGE=true weaveworks/weave-build:
        parallel: true
    - cd $SRCDIR/test; ./gce.sh setup && eval $(./gce.sh hosts) && ./setup.sh:
        parallel: true
    - cd $SRCDIR/test; eval $(./gce.sh hosts); export COVERAGE=true; ./run_all.sh:
        parallel: true
        timeout: 300
    - cd $SRCDIR; make clean-bin:
        parallel: true
    - docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
        parallel: true
  post:
    - cd $SRCDIR/test; ./gce.sh destroy:
        parallel: true

teardown:
  pre:
    - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; ./gen_coverage_reports.sh):
        parallel: true
    - test "$CIRCLE_NODE_INDEX" != "0" || (go get github.com/mattn/goveralls && goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/test/profile.cov -service=circleci || true):
        parallel: true
    - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; cp coverage.* $CIRCLE_ARTIFACTS):
        parallel: true

deployment:
  hub:
    branch: master
    owner: weaveworks
    commands:
{'fraction_non_alphanumeric': 0.13786253476360746, 'fraction_numerical': 0.0031783869686134287, 'mean_word_length': 2.540787623066104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7673319', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1806, 'n_words': 415}