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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. # return to project master
  54. echo ""
  55. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  56. echo "Checking out master"
  57. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  58. echo ""
  59. git checkout master
  60. # push Maven repository to origin
  61. echo ""
  62. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  63. echo "Pushing Maven repository"
  64. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  65. echo ""
  66. cd ${maven.directory}
  67. git push origin gh-pages
  68. cd ${project.directory}
  69. # push project branches
  70. echo ""
  71. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  72. echo "Pushing master, gh-pages, and tag ${project.tag}"
  73. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  74. echo ""
  75. git push origin master gh-pages tag ${project.tag}