set-hdp-repo-url.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. #
  20. if [ "$1" != '${hdpUrlForCentos6}' ]
  21. then
  22. # Updating for new stack version:
  23. # Create the new stack definition with parameterized repoinfo.xml files.
  24. # Typically, copying the files from the previous version will work.
  25. # Modify the VERSION variable in this file to match the new version
  26. # Modify the previous version to store concrete public repo url
  27. VERSION=2.0.6
  28. C6URL="$1"
  29. C5URL="${C6URL/centos6/centos5}"
  30. S11URL="${C6URL/centos6/suse11}"
  31. if [ "$#" != 2 ]
  32. then
  33. HDPREPO=target/classes/stacks/HDP/${VERSION}/repos
  34. else
  35. HDPREPO=$2/var/lib/ambari-server/resources/stacks/HDP/${VERSION}/repos
  36. fi
  37. echo "Processing '${HDPREPO}/repoinfo.xml' and '${HDPLOCALREPO}/repoinfo.xml'"
  38. echo "$2"
  39. echo "Setting centos5 stack url to '$C5URL'"
  40. sed "s;REPLACE_WITH_CENTOS5_URL;$C5URL;" ${HDPREPO}/repoinfo.xml > ${HDPREPO}/repoinfo.xml.tmp; mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
  41. echo "Setting centos6 stack url to '$C6URL'"
  42. sed "s;REPLACE_WITH_CENTOS6_URL;$C6URL;" ${HDPREPO}/repoinfo.xml > ${HDPREPO}/repoinfo.xml.tmp; mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
  43. echo "Setting suse11 stack url to '$S11URL'"
  44. sed "s;REPLACE_WITH_SUSE11_URL;$S11URL;" ${HDPREPO}/repoinfo.xml > ${HDPREPO}/repoinfo.xml.tmp; mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
  45. fi