dev-push-hyperkube.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. # Copyright 2014 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. # This script builds hyperkube and then the hyperkube image.
  16. # REGISTRY and VERSION must be set.
  17. # Example usage:
  18. # $ export REGISTRY=gcr.io/someone
  19. # $ export VERSION=v1.4.0-testfix
  20. # ./hack/dev-push-hyperkube.sh
  21. # That will build and push gcr.io/someone/hyperkube-amd64:v1.4.0-testfix
  22. set -o errexit
  23. set -o nounset
  24. set -o pipefail
  25. KUBE_ROOT="$(dirname "${BASH_SOURCE[0]}")/.."
  26. source "${KUBE_ROOT}/build/common.sh"
  27. if [[ -z "${REGISTRY:-}" ]]; then
  28. echo "REGISTRY must be set"
  29. exit 1
  30. fi
  31. if [[ -z "${VERSION:-}" ]]; then
  32. echo "VERSION must be set"
  33. exit 1
  34. fi
  35. IMAGE="${REGISTRY}/hyperkube-amd64:${VERSION}"
  36. kube::build::verify_prereqs
  37. kube::build::build_image
  38. kube::build::run_build_command make WHAT=cmd/hyperkube
  39. kube::build::copy_output
  40. make -C "${KUBE_ROOT}/cluster/images/hyperkube" build
  41. docker push "${IMAGE}"