github.com/jenkins-x/test-infra@v0.0.7/hack/update-deps.sh (about)

     1  #!/bin/bash
     2  # Copyright 2018 The Kubernetes Authors.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  
    17  # Run dep ensure and generate bazel rules.
    18  #
    19  # Usage:
    20  #   update-deps.sh <ARGS>
    21  #
    22  # The args are sent to dep ensure -v <ARGS>
    23  
    24  set -o nounset
    25  set -o errexit
    26  set -o pipefail
    27  set -o xtrace
    28  
    29  TESTINFRA_ROOT=$(git rev-parse --show-toplevel)
    30  cd "${TESTINFRA_ROOT}"
    31  
    32  trap 'echo "FAILED" >&2' ERR
    33  # dep itself has a problematic testdata directory with infinite symlinks which
    34  # makes bazel sad: https://github.com/golang/dep/pull/1412
    35  # dep should probably be removing it, but it doesn't:
    36  # https://github.com/golang/dep/issues/1580
    37  rm -rf vendor/github.com/golang/dep/internal/fs/testdata
    38  # go-bindata does too, and is not maintained ...
    39  rm -rf vendor/github.com/jteeuwen/go-bindata/testdata
    40  # docker has a contrib dir with nothing we use in it, dep will retain the licenses
    41  # which includes some GPL, so we manually prune this. 
    42  # See https://github.com/kubernetes/steering/issues/57
    43  rm -rf vendor/github.com/docker/docker/contrib
    44  bazel run //:dep -- ensure -v "$@"
    45  rm -rf vendor/github.com/golang/dep/internal/fs/testdata
    46  rm -rf vendor/github.com/jteeuwen/go-bindata/testdata
    47  rm -rf vendor/github.com/docker/docker/contrib
    48  hack/update-bazel.sh
    49  echo SUCCESS