You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release.template 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/bin/bash
  2. #
  3. # ${project.version} release script
  4. #
  5. # In order to build on CI systems, we need to make sure we have a Ant
  6. # that we can use. Ant 1.10 requires Java 8, so we cannot use it for
  7. # the current version. Instead, Moxie can be used if present.
  8. if command -v ant 2> /dev/null 1>&2 ; then
  9. if ant -version 2> /dev/null ; then
  10. antCmd=ant
  11. fi
  12. fi
  13. if [ -z "$antCmd" ] ; then
  14. if command -v moxie 2> /dev/null 1>&2 ; then
  15. antCmd=moxie
  16. fi
  17. fi
  18. if [ -z "$antCmd" ] ; then
  19. echo "Cannot find suitable ant or moxie. No build is possible."
  20. exit 1
  21. fi
  22. # Check which branch we are on, so we can run this script not only on master
  23. branch=$(git symbolic-ref -q --short HEAD)
  24. # ensure Maven repository is up-to-date
  25. echo ""
  26. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  27. echo "Preparing Maven repository"
  28. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  29. echo ""
  30. cd ${maven.directory}
  31. git checkout gh-pages
  32. git pull
  33. cd ${project.directory}
  34. # go back one commit to RELEASE commit (fzs: what, why? Let's go to the tag)
  35. echo ""
  36. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  37. echo "Checking out ${project.version} RELEASE commit ${project.tag}"
  38. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  39. echo ""
  40. git checkout ${project.tag}
  41. # build RELEASE artifacts
  42. echo ""
  43. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  44. echo "Building ${project.version} RELEASE artifacts"
  45. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  46. echo ""
  47. $antCmd clean buildAll buildMavenArtifacts
  48. # commit all generated artifacts and metadata
  49. echo ""
  50. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  51. echo "Committing Maven repository ${project.version} RELEASE artifacts"
  52. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  53. echo ""
  54. cd ${maven.directory}
  55. git add .
  56. git commit -m "${project.version} artifacts"
  57. cd ${project.directory}
  58. # build RELEASE site
  59. echo ""
  60. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  61. echo "Updating ${project.version} website"
  62. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  63. echo ""
  64. $antCmd updateSite
  65. # upload artifacts
  66. echo ""
  67. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  68. echo "Uploading ${project.version} artifacts"
  69. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  70. echo ""
  71. $antCmd releaseBinaries
  72. # push Maven repository to origin
  73. echo ""
  74. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  75. echo "Pushing Maven repository"
  76. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  77. echo ""
  78. cd ${maven.directory}
  79. git push origin gh-pages
  80. cd ${project.directory}
  81. # push project branches
  82. echo ""
  83. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  84. echo "Pushing master, gh-pages, and tag ${project.tag}"
  85. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  86. echo ""
  87. git push origin gh-pages ${project.tag}
  88. # publish release draft
  89. echo ""
  90. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  91. echo "Publishing release ${project.version}"
  92. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  93. echo ""
  94. $antCmd publishRelease
  95. # merge to master (fzs: what? why merging?)
  96. echo ""
  97. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  98. echo "Updating build identifier for next release cycle"
  99. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  100. echo ""
  101. git checkout ${branch}
  102. $antCmd nextPointReleaseCycle
  103. git push origin