16.install_gradle.sh 680 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. set -x
  6. # Install gradle
  7. gradle_version=8.0
  8. if [ ! -d "/opt/gradle/gradle-${gradle_version}" ]
  9. then
  10. echo "Directory /opt/gradle/gradle-${gradle_version} DOES NOT exists."
  11. curl --head https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
  12. (cd /tmp && sudo curl -OL https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip)
  13. sudo unzip -d /opt/gradle /tmp/gradle-${gradle_version}-all.zip
  14. fi
  15. export GRADLE_HOME=/opt/gradle/gradle-${gradle_version}
  16. export PATH=${GRADLE_HOME}/bin:${PATH}
  17. echo ""
  18. echo "Optional steps:"
  19. echo " $ cd REPOSITORY"
  20. echo " $ gradle wrapper"