Skip to content

tech-ajit-mob/jenkins-cicd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jenkins-cicd

This page will guide different steps required to setup a Jenkins and its pre-requisites.

Install Java 17

  • sudo apt-get update
  • sudo apt-get install openjdk-17-jdk

Check Installation

  • java -version

Git

Installation

  • sudo apt-get update
  • sudo apt-get install git-core
  • git --version

Generating SSH Key

  • ssh-keygen
  • eval "$(ssh-agent -s)"
  • ssh-add ~/.ssh/id_rsa
  • cat < ~/.ssh/id_rsa.pub

Installing Jenkins on Ubuntu 22.04

For more details plese visit - https://pkg.jenkins.io/debian-stable/

Steps to install Jenkins

Open terminal and execute below command

Enable Jenkins Service

  • sudo systemctl enable jenkins
  • sudo systemctl start jenkins
  • sudo systemctl status jenkins

Get Initial Admin password

  • sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Install Maven

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.

Check Installation

  • mvn --version

Upgrade Jenkins on Ubuntu

Follow the below steps to upgrade the Jenkins instance to the latest in the current lab.

STOP Jenkins Service

  • sudo /etc/init.d/jenkins stop

Rename the Jenkins war file to war.old

  • cd /usr/share/jenkins
  • sudo mv jenkins.war jenkins.war.old

Download latest war file

START Jenkins Service

  • sudo /etc/init.d/jenkins start

Git Practice commands

Below are some commands commonly used with Git to manage your code in repository.

Clone a git repo

  • git clone

Create a new branch

  • git branch

Switch branch

  • git checkout

Create and switch branch

  • git checkout -b

Push the newly created branch to the remote

  • git push -u origin

Push change to remote branch

  • git push

Pull change to remote branch

  • git pull

Commit the change to the local branch

  • git commit -m "Comment here"

Adding a file to the stage area or index

  • git add filename

Remove a file to the stage area or index

  • git rm --cached filename

Remove all the uncommitted changes

  • git reset --hard

Install Docker using below URL

Run SonarQube as Docker Container

  • docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube

Installing Docker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published