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.

start.sh 986B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. ###############################
  3. # usage: use -d option to enable remote debugging of the web server on port 5005
  4. ###############################
  5. if [[ "$OSTYPE" == "darwin"* ]]; then
  6. OS='macosx-universal-64'
  7. SED_DISABLE_BACKUP=" ''"
  8. else
  9. OS='linux-x86-64'
  10. SED_DISABLE_BACKUP=""
  11. fi
  12. ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
  13. if [ "$?" != "0" ]; then
  14. echo 'Sources are not built'
  15. ./build.sh
  16. fi
  17. cd sonar-application/target/
  18. ls sonarqube-*/bin/$OS/sonar.sh 1> /dev/null 2>&1
  19. if [ "$?" != "0" ]; then
  20. unzip sonarqube-*.zip
  21. fi
  22. cd sonarqube-*
  23. if [ "$1" = "-d" ]; then
  24. echo "enabling debug in conf/sonar.properties, listening on port 5005"
  25. sed -i $SED_DISABLE_BACKUP '/javaAdditionalOpts/d' conf/sonar.properties
  26. echo "" >> conf/sonar.properties
  27. echo "sonar.web.javaAdditionalOpts=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" >> conf/sonar.properties
  28. fi
  29. bin/$OS/sonar.sh restart
  30. sleep 1
  31. tail -100f logs/sonar.log