release 3.9 KB

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