-
Create Bitbucket account
-
Enable MFA authentication
-
Create Project and repository
-
Write script and push to repository
-
Enable pipeline
-
Install SonarQube
-
Add SonarQube on to your pipeline
In this project we are going to build docker image using Bitbucket, scan the code and push to docker dockerhub.
Launch EC2 Ubuntu instance
Launch Ubuntu server
t2.micro
Add Storage
Add Default VPC, Availability zones
Allow in security group required ports http, ssh, 9000
Follow below commands to install SonarQube
adduser sonarqube #pass: sonar@123
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.4.0.54424.zip
sudo apt install unzip
chmod -R 755 /home/sonarqube/sonarqube-9.4.0.54424
chown -R sonarqube:sonarqube /home/sonarqube/sonarqube-9.4.0.54424
cd sonarqube-9.4.0.54424/bin/linux-x86-64/
should not run as root user:
./sonar.sh start
-
Dockerfile
-
bitbucket-pipelines.yml
-
sonar-project.properties