https://funnelgarden.com/sonarqube-jenkins-docker/
https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-continuous-delivery-by-dockerize-jenkins-f5b9b45b610d
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
------------------------------------------
docker-compose -f docker-compose.yaml up --build
docker rm -f conatinername
docker rmi imagename
docker ps -- List down containers
docker images -- List down images
docker exec -it containername bash
---------JENKINS-----------
Manage Plugins for Jenkins --> SonarQube Scanner and NodeJS
Jenkins --> Global Tool Configuration --> SonarQube Scanner
From Jenkins Bash
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
unzip sonar-scanner-cli-3.3.0.1492-linux.zip
/var/jenkins_home/sonar-scanner/sonar-scanner-3.3.0.1492-linux
-----------------NodeJS on Jenkins------------------
# Run as root on RHEL, CentOS, CloudLinux or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash
# Install as Root
yum install -y nodejs
----------HOST--------------------
IFCONFIG of Host i.e localhost --> XX.XX
-----------SONARQUBE--------------
Administrations --> Configuration --> WebHooks
http://192.168.XX.XX:8080/sonarqube-webhook
My Account > Security > Tokens --> Generate and Copy
---------------JENKINS---------------
Manage Jenkins > Configure System > SonarQube Servers
http://192.168.XX.XX:9000
------------------------------------
New Item --> Freestyle --> General, Source Management, Build
sonar.projectKey=Pulse
sonar.projectName=Pulse
sonar.sources=.
sonar.sourceEncoding=UTF-8
-------------------COMPOSE------------------------
version: '3.2' #docker-compose.yml
services:
sonarqube:
privileged: true
ports:
- 9000:9000
- 9092:9092
image: sonarqube
volumes:
- /home/XXX/DockerContainers/sonarqube/conf:/opt/sonarqube/conf
- /home/XXX/DockerContainers/sonarqube/data:/opt/sonarqube/data
- /home/XXX/DockerContainers/sonarqube/logs:/opt/sonarqube/logs
jenkins:
privileged: true
user: root
ports:
- 8080:8080
- 50000:50000
image: jenkins/jenkins
volumes:
- /home/XXX/DockerContainers/jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- sonarqube
https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-continuous-delivery-by-dockerize-jenkins-f5b9b45b610d
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
------------------------------------------
docker-compose -f docker-compose.yaml up --build
docker rm -f conatinername
docker rmi imagename
docker ps -- List down containers
docker images -- List down images
docker exec -it containername bash
---------JENKINS-----------
Manage Plugins for Jenkins --> SonarQube Scanner and NodeJS
Jenkins --> Global Tool Configuration --> SonarQube Scanner
From Jenkins Bash
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
unzip sonar-scanner-cli-3.3.0.1492-linux.zip
/var/jenkins_home/sonar-scanner/sonar-scanner-3.3.0.1492-linux
-----------------NodeJS on Jenkins------------------
# Run as root on RHEL, CentOS, CloudLinux or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash
# Install as Root
yum install -y nodejs
----------HOST--------------------
IFCONFIG of Host i.e localhost --> XX.XX
-----------SONARQUBE--------------
Administrations --> Configuration --> WebHooks
http://192.168.XX.XX:8080/sonarqube-webhook
My Account > Security > Tokens --> Generate and Copy
---------------JENKINS---------------
Manage Jenkins > Configure System > SonarQube Servers
http://192.168.XX.XX:9000
------------------------------------
New Item --> Freestyle --> General, Source Management, Build
sonar.projectKey=Pulse
sonar.projectName=Pulse
sonar.sources=.
sonar.sourceEncoding=UTF-8
-------------------COMPOSE------------------------
version: '3.2' #docker-compose.yml
services:
sonarqube:
privileged: true
ports:
- 9000:9000
- 9092:9092
image: sonarqube
volumes:
- /home/XXX/DockerContainers/sonarqube/conf:/opt/sonarqube/conf
- /home/XXX/DockerContainers/sonarqube/data:/opt/sonarqube/data
- /home/XXX/DockerContainers/sonarqube/logs:/opt/sonarqube/logs
jenkins:
privileged: true
user: root
ports:
- 8080:8080
- 50000:50000
image: jenkins/jenkins
volumes:
- /home/XXX/DockerContainers/jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- sonarqube