k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/build/release-in-a-container.sh (about)

     1  #!/usr/bin/env bash
     2  # Copyright 2017 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  set -o errexit
    17  set -o nounset
    18  set -o pipefail
    19  
    20  # Complete the release with the standard env
    21  KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
    22  
    23  # Check and error if not "in-a-container"
    24  if [[ ! -f /.dockerenv ]]; then
    25    echo
    26    echo "'make release-in-a-container' can only be used from a docker container."
    27    echo
    28    exit 1
    29  fi
    30  
    31  # Other dependencies: Your container should contain docker
    32  if ! type -p docker >/dev/null 2>&1; then
    33    echo
    34    echo "'make release-in-a-container' requires a container with" \
    35         "docker installed."
    36    echo
    37    exit 1
    38  fi
    39  
    40  
    41  # First run make cross-in-a-container
    42  make cross-in-a-container
    43  
    44  # at the moment only make test is supported.
    45  if [[ $KUBE_RELEASE_RUN_TESTS =~ ^[yY]$ ]]; then
    46    make test
    47  fi
    48  
    49  "${KUBE_ROOT}/build/package-tarballs.sh"