release-amd64 2.1 KB

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