release-amd64 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. set -ex
  3. cd $(dirname $0)/..
  4. source ./scripts/version
  5. ./scripts/release-build
  6. CHECKSUM="dist/checksums.txt"
  7. rm -f $CHECKSUM
  8. cat scripts/hosting/rancheros.ipxe | sed "s/latest/${VERSION}/g" > dist/artifacts/rancheros.ipxe
  9. echo "github-release release --user rancher --repo os --tag ${VERSION} --pre-release --draft" > dist/publish.sh
  10. chmod 755 dist/publish.sh
  11. touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh
  12. chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh
  13. for file in $(ls dist/artifacts/); do
  14. case $file in
  15. *"installer.tar" | "Dockerfile"*)
  16. ;;
  17. "initrd-"*)
  18. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name initrd" >> dist/publish.sh
  19. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/initrd" >> ./dist/publish_gss_latest.sh
  20. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/initrd" >> ./dist/publish_gss_${VERSION}.sh
  21. ;;
  22. "vmlinuz-"*)
  23. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name vmlinuz" >> dist/publish.sh
  24. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/vmlinuz" >> ./dist/publish_gss_latest.sh
  25. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/vmlinuz" >> ./dist/publish_gss_${VERSION}.sh
  26. ;;
  27. *)
  28. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
  29. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/latest/${file}" >> ./dist/publish_gss_latest.sh
  30. echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/${file}" >> ./dist/publish_gss_${VERSION}.sh
  31. ;;
  32. esac
  33. #checksums
  34. pushd .
  35. cd dist/artifacts
  36. for algo in sha256 md5; do
  37. echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM
  38. done
  39. popd
  40. done
  41. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/release.log --name release.log" >> dist/publish.sh
  42. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
  43. echo >> dist/publish.sh
  44. cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
  45. echo "--- Run dist/publish.sh"
  46. cat dist/publish.sh
  47. echo "--- Run dist/publish_gss.sh"
  48. cat dist/publish_gss_latest.sh
  49. cat dist/publish_gss_${VERSION}.sh