install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Copyright 2016 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 volume is assumed to exist and is shared with parent of the init
  16. # container. It contains the redis installation.
  17. INSTALL_VOLUME="/opt"
  18. # This volume is assumed to exist and is shared with the peer-finder
  19. # init container. It contains on-start/change configuration scripts.
  20. WORK_DIR="/work-dir"
  21. VERSION="3.2.0"
  22. for i in "$@"
  23. do
  24. case $i in
  25. -i=*|--install-into=*)
  26. INSTALL_VOLUME="${i#*=}"
  27. shift
  28. ;;
  29. -w=*|--work-dir=*)
  30. WORK_DIR="${i#*=}"
  31. shift
  32. ;;
  33. *)
  34. # unknown option
  35. ;;
  36. esac
  37. done
  38. echo installing config scripts into "${WORK_DIR}"
  39. mkdir -p "${WORK_DIR}"
  40. cp /on-start.sh "${WORK_DIR}"/
  41. cp /peer-finder "${WORK_DIR}"/
  42. echo installing redis-"${VERSION}" into "${INSTALL_VOLUME}"
  43. mkdir -p "${INSTALL_VOLUME}"
  44. mv /redis "${INSTALL_VOLUME}"/redis