mac_installer.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. set -e
  3. function usage() {
  4. echo "$0 [options] <tag>"
  5. echo
  6. echo " tag : Release tag (eg: 2.1.4, 2.2-beta1, ...)"
  7. echo
  8. echo "Environment variables:"
  9. echo " SKIP_DOWNLOAD : Skips download of release artifacts"
  10. echo " SKIP_UPLOAD : Skips upload of mac installer"
  11. }
  12. tag=$1
  13. if [ -z $tag ]; then
  14. usage
  15. exit 1
  16. fi
  17. # load properties
  18. . "$( cd "$( dirname "$0" )" && pwd )"/properties
  19. # load common functions
  20. . "$( cd "$( dirname "$0" )" && pwd )"/functions
  21. # download and ready the artifacts
  22. setup_artifacts $tag mac
  23. # Setup_artifacts extracts everything to tmp/
  24. # Those resources are not needed.
  25. rm -fr tmp/*
  26. # Note: the '-mac' directory name is important for the 'build.sh' and 'build.xml' to succeed.
  27. # The build uses a regex to determine and set a variable.
  28. unzip -d tmp/geoserver-$tag-mac files/geoserver-$tag-mac.zip
  29. cp files/geoserver-$tag-bin.zip tmp/geoserver-$tag-mac/
  30. pushd tmp/geoserver-$tag-mac/ > /dev/null
  31. ./build.sh
  32. #popd
  33. # upload dmg to final location
  34. upload_installer $tag geoserver-$tag.dmg
  35. popd > /dev/null
  36. exit 0