release 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/bash
  2. set -ex
  3. cd $(dirname $0)/..
  4. source ./scripts/version
  5. export REPO_VERSION=$VERSION
  6. export COMPRESS="xz --format=lzma -9 --memlimit-compress=80% -e"
  7. ./scripts/ci
  8. # from scripts/ci
  9. echo PREPARE
  10. ./scripts/prepare
  11. echo PACKAGE
  12. ./scripts/package
  13. if [[ "$INTEGRATION_TESTS" != "" ]]; then
  14. if [[ "$ARCH" == "" || "$ARCH" == "amd64" ]]; then
  15. export INTEGRATION_TESTS=1
  16. else
  17. export INTEGRATION_TESTS=0
  18. fi
  19. fi
  20. if [[ "$INTEGRATION_TESTS" != "1" ]]; then
  21. echo INTEGRATION-TEST
  22. ./scripts/integration-test
  23. else
  24. echo "Skipping integration tests"
  25. fi
  26. #if [[ "$ARCH" == "" || "$ARCH" == "amd64" ]]; then
  27. ## make generated changelog
  28. #lastrelease=$(hub release | grep -v rc | head -n1 | tr -d ' \r\n')
  29. #git log --format="%s: %b" ${lastrelease}..${VERSION} | grep "Merge pull" | sed 's/.*\(#.*\) from .*:\(.*\)/* \1: \2/g' > dist/artifacts/changelog.txt
  30. #fi
  31. CHECKSUM="dist/checksums.txt"
  32. rm -f $CHECKSUM
  33. cat scripts/hosting/rancheros.ipxe | sed "s/latest/${VERSION}/g" > dist/artifacts/rancheros.ipxe
  34. echo "github-release release --user rancher --repo os --tag ${VERSION} --pre-release --draft" > dist/publish.sh
  35. chmod 755 dist/publish.sh
  36. touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh
  37. chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh
  38. for file in $(ls dist/artifacts/); do
  39. case $file in
  40. *"installer.tar" | "Dockerfile"*)
  41. ;;
  42. "initrd-"*)
  43. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name initrd" >> dist/publish.sh
  44. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/initrd" >> ./dist/publish_gss_latest.sh
  45. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/initrd" >> ./dist/publish_gss_${VERSION}.sh
  46. ;;
  47. "vmlinuz-"*)
  48. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name vmlinuz" >> dist/publish.sh
  49. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/vmlinuz" >> ./dist/publish_gss_latest.sh
  50. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/vmlinuz" >> ./dist/publish_gss_${VERSION}.sh
  51. ;;
  52. *)
  53. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
  54. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/${file}" >> ./dist/publish_gss_latest.sh
  55. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/${file}" >> ./dist/publish_gss_${VERSION}.sh
  56. ;;
  57. esac
  58. #checksums
  59. pushd .
  60. cd dist/artifacts
  61. for algo in sha256 md5; do
  62. echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM
  63. done
  64. popd
  65. done
  66. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/release.log --name release.log" >> dist/publish.sh
  67. for extra_file in rancheros-openstack.img rancheros-digitalocean.img; do
  68. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${extra_file} --name ${extra_file}" >> dist/publish.sh
  69. echo "gsutil cp dist/artifacts/${extra_file} gs://releases.rancher.com/os/latest/${extra_file}" >> ./dist/publish_gss_latest.sh
  70. echo "gsutil cp dist/artifacts/${extra_file} gs://releases.rancher.com/os/${VERSION}/${extra_file}" >> ./dist/publish_gss_${VERSION}.sh
  71. done
  72. # openstack image is made later atm
  73. #pushd .
  74. #cd dist
  75. #for algo in sha256 md5; do
  76. # echo "$algo: $(${algo}sum rancheros-openstack.img)" >> ../../$CHECKSUM
  77. #done
  78. #popd
  79. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
  80. #echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/changelog.txt --name changelog.txt" >> dist/publish.sh
  81. echo >> dist/publish.sh
  82. cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
  83. echo "--- Run dist/publish.sh"
  84. cat dist/publish.sh
  85. echo "--- Run dist/publish_gss.sh"
  86. cat dist/publish_gss_latest.sh
  87. cat dist/publish_gss_${VERSION}.sh