- EC2 type – Ubuntu t2.medium
- EBS volume – 30 GB
- Region -AP SOUTH 1
- To login as root user - sudo su
- Just copy paste the entire command
sudo apt update -y
sudo apt upgrade -y
sudo apt install openjdk-17-jre -y
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update -y
sudo apt-get install jenkins -y
- All traffic
- Anywhere IPV4
- http://<EC2_PUBLIC_IP>:8080/
- cat/var/lib/jenkins/secrets/initialAdminPassword
- https://github.com/tohidhanfi20/Java_app_3.0
- Plugins for Sonar/Jfrog
– Sonar Gerrit
- SonarQube Scanner
- SonarQube Generic Coverage
- Sonar Quality Gates
- Quality Gates
- Artifactory
- Jfrog
-
Just copy paste the entire command
- sudo apt update -y sudo apt install apt-transport-https ca-certificates curl software-properties-common -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -y sudo apt update -y apt-cache policy docker-ce -y sudo apt install docker-ce -y sudo systemctl status docker sudo chmod 777 /var/run/docker.sock
- docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
- docker ps -a [Get the container ID]
- docker start <containerID>
Step 13.2 -> Log in into sonar dashboard
- Username – admin
- Password – admin
Sonar Dashboard -> Top right corner -> MyAccount -> Security -> Create token -> Save the token to some text file
Sonar Dashboard -> Administration -> Configuration -> webhooks -> Add the below name and url and save
- http://<EC2_IP>:8080/sonarqube-webhook/
-
Just copy paste the entire command
- sudo apt update -y sudo apt install maven -y mvn -version
-
Just copy paste the entire command
-
A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI.
- sudo apt-get install wget apt-transport-https gnupg lsb-release wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add - echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list sudo apt-get update sudo apt-get install trivy
Jenkins Dashboard -> Manage Jenkins -> configure system
Step 17.1 -> Click on sonarqube servers -> add url and name -> Click on add token -> Select Secret text -> Add the sonar token from
step13.3 -> Give name of token as sonarqube-api
jenkins dashboard -> Manage Jenkins -> Credentials -> System -> click on global credentials
ADD the docker hub credentials with name as docker
Go to Manage Jenkins -> Configure system -> Global pipeline library -> Add below data Name -my-shared-library Default version – main
git - https://github.com/tohidhanfi20/jenkins_shared_lib
- The Jenkins logs
- The Trivy scan vulnerabilities
- The sonarqube dashboard for report