release 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. for file in $(ls dist/artifacts/); do
  37. if [[ "$file" == *"installer.tar" ]]; then
  38. continue
  39. fi
  40. if [[ "$file" == "Dockerfile"* ]]; then
  41. continue
  42. fi
  43. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
  44. if [[ "$file" == "initrd-"* ]]; then
  45. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name initrd" >> dist/publish.sh
  46. fi
  47. if [[ "$file" == "vmlinuz-"* ]]; then
  48. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name vmlinuz" >> dist/publish.sh
  49. fi
  50. #checksums
  51. pushd .
  52. cd dist/artifacts
  53. for algo in sha256 md5; do
  54. echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM
  55. done
  56. popd
  57. done
  58. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/release.log --name release.log" >> dist/publish.sh
  59. # openstack image is made later atm
  60. #echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/rancheros-openstack.img --name rancheros-openstack.img" >> dist/publish.sh
  61. #pushd .
  62. #cd dist
  63. #for algo in sha256 md5; do
  64. # echo "$algo: $(${algo}sum rancheros-openstack.img)" >> ../../$CHECKSUM
  65. #done
  66. #popd
  67. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
  68. echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/changelog.txt --name changelog.txt" >> dist/publish.sh
  69. echo >> dist/publish.sh
  70. cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
  71. echo "--- Run dist/publish.sh"
  72. cat dist/publish.sh