release 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. set -e
  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. export INTEGRATION_TESTS=0
  8. ./scripts/ci
  9. # make generated changelog
  10. lastrelease=$(hub release | grep -v rc | head -n1 | tr -d ' \r\n')
  11. git log --format="%s: %b" ${lastrelease}..${VERSION} | grep "Merge pull" | sed 's/.*\(#.*\) from .*:\(.*\)/* \1: \2/g' > dist/artifacts/changelog.txt
  12. CHECKSUM="dist/checksums.txt"
  13. rm -f $CHECKSUM
  14. cat scripts/hosting/rancheros.ipxe | sed "s/latest/${VERSION}/g" > dist/artifacts/rancheros.ipxe
  15. echo "github-release release --user rancher --repo os --tag ${VERSION} --pre-release --draft" > dist/publish.sh
  16. chmod 755 dist/publish.sh
  17. for file in $(ls dist/artifacts/); do
  18. if [[ "$file" == *"installer.tar" ]]; then
  19. continue
  20. fi
  21. if [[ "$file" == "Dockerfile"* ]]; then
  22. continue
  23. fi
  24. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
  25. if [[ "$file" == "initrd-"* ]]; then
  26. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name initrd" >> dist/publish.sh
  27. fi
  28. if [[ "$file" == "vmlinuz-"* ]]; then
  29. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name vmlinuz" >> dist/publish.sh
  30. fi
  31. #checksums
  32. pushd .
  33. cd dist/artifacts
  34. for algo in sha256 md5; do
  35. echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM
  36. done
  37. popd
  38. done
  39. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/release.log --name release.log" >> dist/publish.sh
  40. # openstack image is made later atm
  41. #echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/rancheros-openstack.img --name rancheros-openstack.img" >> dist/publish.sh
  42. #pushd .
  43. #cd dist
  44. #for algo in sha256 md5; do
  45. # echo "$algo: $(${algo}sum rancheros-openstack.img)" >> ../../$CHECKSUM
  46. #done
  47. #popd
  48. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
  49. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/changelog.txt --name changelog.txt" >> dist/publish.sh
  50. echo >> dist/publish.sh
  51. cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
  52. echo "--- Run dist/publish.sh"
  53. cat dist/publish.sh