release-in-a-container.sh 1.3 KB

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