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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. #
  3. # ${project.version} release script
  4. #
  5. # ensure Maven repository is up-to-date
  6. echo ""
  7. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  8. echo "Preparing Maven repository"
  9. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  10. echo ""
  11. cd ${maven.directory}
  12. git checkout gh-pages
  13. git pull
  14. cd ${project.directory}
  15. # go back one commit to RELEASE commit
  16. echo ""
  17. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  18. echo "Checking out ${project.version} RELEASE commit ${project.commitId}"
  19. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  20. echo ""
  21. git checkout ${project.commitId}
  22. # build RELEASE artifacts
  23. echo ""
  24. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  25. echo "Building ${project.version} RELEASE artifacts"
  26. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  27. echo ""
  28. ant clean buildAll buildMavenArtifacts
  29. # commit all generated artifacts and metadata
  30. echo ""
  31. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  32. echo "Committing Maven repository ${project.version} RELEASE artifacts"
  33. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  34. echo ""
  35. cd ${maven.directory}
  36. git add .
  37. git commit -m "${project.version} artifacts"
  38. cd ${project.directory}
  39. # upload artifacts
  40. echo ""
  41. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  42. echo "Uploading ${project.version} artifacts"
  43. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  44. echo ""
  45. ant publishBinaries
  46. # build site, update gh-pages, and ftp upload site to hosting provider
  47. echo ""
  48. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  49. echo "Building ${project.version} website"
  50. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  51. echo ""
  52. ant publishSite
  53. # merge to master
  54. echo ""
  55. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  56. echo "Merging release ${project.version} to master"
  57. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  58. echo ""
  59. git checkout master
  60. git merge --no-ff -m "Merge release ${project.version}" ${project.commitId}
  61. ant nextPointReleaseCycle
  62. # merge to develop
  63. echo ""
  64. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  65. echo "Merging release ${project.version} to develop"
  66. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  67. echo ""
  68. git checkout develop
  69. git merge --no-ff -m "Merge release ${project.version}" ${project.commitId}
  70. ant nextMinorReleaseCycle
  71. # push Maven repository to origin
  72. echo ""
  73. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  74. echo "Pushing Maven repository"
  75. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  76. echo ""
  77. cd ${maven.directory}
  78. git push origin gh-pages
  79. cd ${project.directory}
  80. # push project branches
  81. echo ""
  82. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  83. echo "Pushing master, develop, gh-pages, and tag ${project.tag}"
  84. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  85. echo ""
  86. git push origin master develop gh-pages ${project.tag}