Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions java-maven-sonar-argocd-helm-k8s/spring-boot-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ sudo apt update && sudo apt install unzip -y
adduser sonarqube
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.4.1.88267.zip
unzip *
chown -R sonarqube:sonarqube /opt/sonarqube
chmod -R 775 /opt/sonarqube
cd /opt/sonarqube/bin/linux-x86-64
chown -R sonarqube:sonarqube /home/sonarqube/sonarqube
chmod -R 775 /home/sonarqube/sonarqube
cd /home/sonarqube/sonarqube/bin/linux-x86-64
./sonar.sh start
```
Comment on lines 61 to 68
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Extraction folder not created → subsequent chown, chmod, and cd will fail

unzip * extracts into sonarqube-10.4.1.88267/ (or whatever versioned dir), not /home/sonarqube/sonarqube.
Therefore the three commands that follow reference a non-existent path and will error.

-wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.4.1.88267.zip
-unzip *
-chown -R sonarqube:sonarqube /home/sonarqube/sonarqube
-chmod -R 775 /home/sonarqube/sonarqube
-cd /home/sonarqube/sonarqube/bin/linux-x86-64
+wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.4.1.88267.zip
+unzip sonarqube-10.4.1.88267.zip
+mv sonarqube-10.4.1.88267 /home/sonarqube/sonarqube
+chown -R sonarqube:sonarqube /home/sonarqube/sonarqube
+chmod -R 775 /home/sonarqube/sonarqube
+cd /home/sonarqube/sonarqube/bin/linux-x86-64

Alternatively, keep the versioned directory and adjust the subsequent paths.
Without this fix, newcomers following the README will hit No such file or directory.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
adduser sonarqube
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.4.1.88267.zip
unzip *
chown -R sonarqube:sonarqube /opt/sonarqube
chmod -R 775 /opt/sonarqube
cd /opt/sonarqube/bin/linux-x86-64
chown -R sonarqube:sonarqube /home/sonarqube/sonarqube
chmod -R 775 /home/sonarqube/sonarqube
cd /home/sonarqube/sonarqube/bin/linux-x86-64
./sonar.sh start
```
adduser sonarqube
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.4.1.88267.zip
unzip sonarqube-10.4.1.88267.zip
mv sonarqube-10.4.1.88267 /home/sonarqube/sonarqube
chown -R sonarqube:sonarqube /home/sonarqube/sonarqube
chmod -R 775 /home/sonarqube/sonarqube
cd /home/sonarqube/sonarqube/bin/linux-x86-64
./sonar.sh start
🤖 Prompt for AI Agents
In java-maven-sonar-argocd-helm-k8s/spring-boot-app/README.md around lines 61 to
68, the unzip command extracts files into a versioned directory (e.g.,
sonarqube-10.4.1.88267/) rather than /home/sonarqube/sonarqube, causing the
following chown, chmod, and cd commands to fail due to incorrect paths. Fix this
by either extracting directly into /home/sonarqube/sonarqube or updating the
chown, chmod, and cd commands to use the actual extracted versioned directory
path.


Expand Down