Installation of Maven build tool in Ubuntu 20.04 LTS
a) Update the system repository using:
sudo apt update
b) Install Maven from the official repository:
sudo apt install maven
c) When prompted, type Y and press Enter to confirm the installation.
d) Check the current version of Maven to verify the installation:
mvn -version
If successful, the output will look like this:
e) How to build java maven project
Change directory (cd ) to project name:
Run mvn compile : It will create a target folder after that run mvn package it will generate the zip artefact in the target folder.
How to install Docker in Ubuntu:
How to install Docker in Ubuntu 20.04
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 focal stable”
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
Prerequisites
Port opens:
TCP: 9000
TCP: 5432
TCP: 22:
TCP: 443
To Increase the vm.max_map_count kernal ,file discriptor and ulimit for current session at runtime.
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w fs.file-max=65536
ulimit -n 65536
Sudo apt-get upgrade
Sudo apt-get update
sudo apt-get install openjdk-11-jdk -y
sudo apt-get install openjdk-11-jre -y
Check java version:
Install and Setup PostgreSQL 10 Database For SonarQube
sudo apt-get -y install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo passwd postgres
su – postgres
createuser sonar
Password: Glob@qw
Type:psql
ALTER USER sonar WITH ENCRYPTED password ‘sonar’;
grant all privileges on DATABASE sonarqube to sonar;
q
exit
Create a sonar user :
Password for soanr user: MasterB#456OpLead
Configure SonarQube
Copy sonarqube-9.7.1.62043.zip to /opt: and unzip
sudo unzip sonarqube-9.7.1.62043.zip -d /opt
sudo mv /opt/sonarqube-9.7.1.62043 /opt/sonarqube
Give access to the sonar user:
sudo useradd -c “user to run SonarQube” -d /opt/sonarqube -g sonar sonar
sudo chown sonar:sonar /opt/sonarqube -R
sudo vim /opt/sonarqube/conf/sonar.properties
Update the username and password of database:
sudo vim /opt/sonarqube/bin/linux-x86-64/sonar.sh
sudo su sonar
cd /opt/sonarqube/bin/linux-x86-64/
./sonar.sh start
Configure Systemd service:
cd /opt/sonarqube/bin/linux-x86-64/
./sonar.sh stop
sudo vim /etc/systemd/system/sonar.service
sudo systemctl start sonar
sudo systemctl enable sonar
Click on the link below:
http://3.239.83.182:9000/sessions/new?return_to=%2F
Username:admin
Password: Glob@qw
Which are some of the most popular DevOps tools?
What is the git command that downloads any repository from GitHub to your computer?
git clone <repo url>
Which of the following CLI commands can be used to rename files?
git mv repo_name destination_repo_name
What is the process for reverting a commit that has already been pushed and made public?
Create a new commit with the latest changes that were made in the bad commit. Use the following command: git revert <commit_id>