Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humbertodias/4e2eef97e7a29a703618334699c12a3d to your computer and use it in GitHub Desktop.
Save humbertodias/4e2eef97e7a29a703618334699c12a3d to your computer and use it in GitHub Desktop.
Install sonar-scanner in linux mint, ubuntu...
#!/bin/bash
# https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip
SONAR_SCANNER_VERSION=4.5.0.2216
cd /tmp || exit
echo "Downloading sonar-scanner....."
if [ -d "/tmp/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" ];then
sudo rm /tmp/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
fi
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
echo "Download completed."
echo "Unziping downloaded file..."
unzip sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
echo "Unzip completed."
rm sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
echo "Installing to opt..."
if [ -d "/var/opt/sonar-scanner-$SONAR_SCANNER_VERSION-linux" ];then
sudo rm -rf /var/opt/sonar-scanner-$SONAR_SCANNER_VERSION-linux
fi
sudo mv sonar-scanner-$SONAR_SCANNER_VERSION-linux /var/opt
echo "Installation completed successfully."
echo "You can use sonar-scanner!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment