- sudo apt-get update
- sudo apt-get install openjdk-17-jdk
- java -version
- sudo apt-get update
- sudo apt-get install git-core
- git --version
- ssh-keygen
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- cat < ~/.ssh/id_rsa.pub
For more details plese visit - https://pkg.jenkins.io/debian-stable/
Open terminal and execute below command
-
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
-
sudo apt-get install jenkins
- sudo systemctl enable jenkins
- sudo systemctl start jenkins
- sudo systemctl status jenkins
- sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Download the Maven zip file at the below URL if you want to play with Maven on your local machine. If you want to use it on Jenkins then you can install Maven directly from Jenkins console.
- mkdir tools
- cd tools
- wget https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.zip
- unzip apache-maven-3.9.4-bin.zip
Check Installation
- mvn --version
Follow the below steps to upgrade the Jenkins instance to the latest in the current lab.
- sudo /etc/init.d/jenkins stop
- cd /usr/share/jenkins
- sudo mv jenkins.war jenkins.war.old
- sudo /etc/init.d/jenkins start
Below are some commands commonly used with Git to manage your code in repository.
- git clone
- git branch
- git checkout
- git checkout -b
- git push -u origin
- git push
- git pull
- git commit -m "Comment here"
- git add filename
- git rm --cached filename
- git reset --hard
- docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube