Git Product home page Git Product logo

jenkins-cicd's Introduction

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 -y

Check Installation

  • java -version

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

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 -y

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

Git

Installation

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

Generating SSH Key

  • ssh-keygen ----- generate key
  • eval "$(ssh-agent -s)" -- Start Agent
  • ssh-add ~/.ssh/id_rsa --- Add key in agent
  • cat < ~/.ssh/id_rsa.pub


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.

Using package

  • sudo apt-get install maven -y

##OR Using zip file

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 the below URL

Run SonarQube as Docker Container

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

Installing Docker

jenkins-cicd's People

Contributors

vcjain avatar vikash-galaxyweblinks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.