- 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 ----- generate key
- eval "$(ssh-agent -s)" -- Start Agent
- ssh-add ~/.ssh/id_rsa --- Add key in agent
- 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.
Using package
- sudo apt-get install maven -y
##OR Using zip file
- 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
- https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04 Run the below command to run Jenkins as a docker container
- docker run --name jenkins -p 8080:8080 -p 50000:50000 -v jenkins:/var/jenkins_home -d jenkins/jenkins:lts-jdk17
- sudo docker logs jenkins
- docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube