Skip to content

Instantly share code, notes, and snippets.

@jhoanborges
Created September 23, 2024 17:10
Show Gist options
  • Save jhoanborges/0dcd3460ff8a5746a29e2dc909d932fc to your computer and use it in GitHub Desktop.
Save jhoanborges/0dcd3460ff8a5746a29e2dc909d932fc to your computer and use it in GitHub Desktop.
sonar-scanner-cli-6.1.0.4477 for Linux Ubuntu
#!/bin/bash
# https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip
SONAR_SCANNER_VERSION=sonar-scanner-cli-6.1.0.4477-linux-x64
cd /tmp || exit
echo "Downloading sonar-scanner....."
if [ -d "/tmp/$SONAR_SCANNER_VERSION.zip" ];then
sudo rm /tmp/$SONAR_SCANNER_VERSION.zip
fi
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/$SONAR_SCANNER_VERSION.zip
echo "Download completed."
echo "Unziping downloaded file..."
unzip $SONAR_SCANNER_VERSION.zip
echo "Unzip completed."
rm $SONAR_SCANNER_VERSION.zip
echo "Installing to opt..."
if [ -d "/var/opt/sonar-scanner-$SONAR_SCANNER_VERSION" ];then
sudo rm -rf /var/opt/sonar-scanner-$SONAR_SCANNER_VERSION
fi
sudo mv sonar-scanner-$SONAR_SCANNER_VERSION /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