github.com/google/cadvisor@v0.49.1/build/prow_e2e.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Copyright 2018 Google Inc. All rights reserved.
     4  #
     5  # Licensed under the Apache License, Version 2.0 (the "License");
     6  # you may not use this file except in compliance with the License.
     7  # You may obtain a copy of the License at
     8  #
     9  #     http://www.apache.org/licenses/LICENSE-2.0
    10  #
    11  # Unless required by applicable law or agreed to in writing, software
    12  # distributed under the License is distributed on an "AS IS" BASIS,
    13  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  # See the License for the specific language governing permissions and
    15  # limitations under the License.
    16  
    17  set -e
    18  set -x
    19  
    20  BUILDER=${BUILDER:-false} # Whether this is running a PR builder job.
    21  
    22  export GO_FLAGS="-race"
    23  export GORACE="halt_on_error=1"
    24  
    25  # cd to cadvisor directory
    26  parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
    27  cd "$parent_path/.."
    28  
    29  # Check whether assets need to be rebuilt.
    30  FORCE=true build/assets.sh
    31  if [[ ! -z "$(git diff --name-only -- cmd/internal/pages)" ]]; then
    32    echo "Found changes to UI assets:"
    33    git diff --name-only -- cmd/internal/pages
    34    echo "Run: 'make assets FORCE=true'"
    35    exit 1
    36  fi
    37  
    38  make all
    39  
    40  # compile integration tests so they can be run without go installed
    41  go test -c github.com/google/cadvisor/integration/tests/api
    42  go test -c github.com/google/cadvisor/integration/tests/healthz