<commit_before>dist: trusty
sudo: required

notifications:
    email: false

language: go
go_import_path: github.com/HewlettPackard/terraform-provider-oneview

go:
    - 1.11

env:
    global:
        - BUILDNAME=terraform-provider-oneview
        - TF_DOWNLOAD_PATH=./bins
        - TF_PLATFORMS="linux"
        - CGO_ENABLED=0
        - GOARCH=amd64
        - REPO=$DOCKER_USERNAME/terraform-provider-oneview
        - TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "branch-${TRAVIS_BRANCH}"; fi)
        - UNFORMATTED=$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)

install:
    - mkdir -p $TF_DOWNLOAD_PATH
    - bash <(curl -s https://raw.githubusercontent.com/patrickdappollonio/download-terraform-binaries/master/download_terraform_binaries.sh)
      echo -e "End of install"

before_script:
        echo -e "Entered before script"
    - if ! [ -z "$UNFORMATTED" ]; then
        echo -e "Go files must be formatted with gofmt. Please run:";
        for fn in $UNFORMATTED; do
        echo -e "  gofmt -w $PWD/$fn";
        done;
        exit 1;
      fi
      echo -e "End of before_script"

script:
    # Standard Go testing avoiding the testing of the vendor folder.
    echo -e "go vet start"
    - go vet $(go list ./... | grep -v '/vendor/')
      echo -e "After go vet"
    - go test -v $(go list ./... | grep -v '/vendor/')

    # Build disabling CGO and getting a statically linked binary.
    echo -e "Disabling CGO"
    - GOOS=linux go build -a -tags netgo -ldflags '-s -w' -o $TF_DOWNLOAD_PATH/linux/$BUILDNAME

    # Create the docker image from the Dockerfile.
    echo -e "Before docker build"
    - docker build -f Dockerfile -t $REPO:$TAG .

    # Run a Sanity Check against an empty terraform file. When
    # ran, it should fail if the compilation was unsuccessful.
    - docker run -it --rm=true $REPO:$TAG /bin/ash -c "echo '' >> /demo.tf && cd / && /usr/local/terraform/terraform plan"

after_success:
    - if [ "$TRAVIS_BRANCH" == "master" ]; then
        docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
        docker push $REPO;
      fi<commit_msg>Debugging travis build<commit_after>dist: trusty
sudo: required

notifications:
    email: false

language: go
go_import_path: github.com/HewlettPackard/terraform-provider-oneview

go:
    - 1.11

env:
    global:
        - BUILDNAME=terraform-provider-oneview
        - TF_DOWNLOAD_PATH=./bins
        - TF_PLATFORMS="linux"
        - CGO_ENABLED=0
        - GOARCH=amd64
        - REPO=$DOCKER_USERNAME/terraform-provider-oneview
        - TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "branch-${TRAVIS_BRANCH}"; fi)
        - UNFORMATTED=$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)

install:
    - mkdir -p $TF_DOWNLOAD_PATH
    - bash <(curl -s https://raw.githubusercontent.com/patrickdappollonio/download-terraform-binaries/master/download_terraform_binaries.sh)
    - echo -e "End of install"

before_script:
    - echo -e "Entered before script"
    - if ! [ -z "$UNFORMATTED" ]; then
        echo -e "Go files must be formatted with gofmt. Please run:";
        for fn in $UNFORMATTED; do
        echo -e "  gofmt -w $PWD/$fn";
        done;
        exit 1;
      fi
     - echo -e "End of before_script"

script:
    # Standard Go testing avoiding the testing of the vendor folder.
    - echo -e "go vet start"
    - go vet $(go list ./... | grep -v '/vendor/')
    - echo -e "After go vet"
    - go test -v $(go list ./... | grep -v '/vendor/')

    # Build disabling CGO and getting a statically linked binary.
    - echo -e "Disabling CGO"
    - GOOS=linux go build -a -tags netgo -ldflags '-s -w' -o $TF_DOWNLOAD_PATH/linux/$BUILDNAME

    # Create the docker image from the Dockerfile.
    - echo -e "Before docker build"
    - docker build -f Dockerfile -t $REPO:$TAG .

    # Run a Sanity Check against an empty terraform file. When
    # ran, it should fail if the compilation was unsuccessful.
    - docker run -it --rm=true $REPO:$TAG /bin/ash -c "echo '' >> /demo.tf && cd / && /usr/local/terraform/terraform plan"

after_success:
    - if [ "$TRAVIS_BRANCH" == "master" ]; then
        docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
        docker push $REPO;
      fi
{'fraction_non_alphanumeric': 0.13319482917820868, 'fraction_numerical': 0.003231763619575254, 'mean_word_length': 2.401098901098901, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1393934', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1497, 'n_words': 439}