# Jenkins Job kya hota hai

![Jenkins - Setup Build Jobs](https://www.tutorialspoint.com/jenkins/images/helloworld_config.jpg align="left")

## Jenkins Job kya hota hai

**Jenkins Job** ek **task / task set** hota hai jo Jenkins automatically run karta hai.  
Is job ke andar hum batate hain ki **kya kaam karna hai, kab karna hai, aur kaise karna hai**.

Simple line me:  
👉 Jenkins Job = automated work unit (build, test, deploy).

Jenkins me sab kuch **job ke through** hi hota hai.

---

## Jenkins job ka role

Job ka kaam hota hai:

* Code build karna
    
* Tests run karna
    
* Application deploy karna
    
* Scripts execute karna
    
* Reports generate karna
    

Jab bhi job run hoti hai, Jenkins wahi steps follow karta hai jo job me defined hote hain.

---

## Jenkins Job ka workflow

1. Developer code push karta hai
    
2. Jenkins job trigger hoti hai
    
3. Jenkins code checkout karta hai
    
4. Build steps run hote hain
    
5. Tests execute hote hain
    
6. Result generate hota hai (success / failure)
    

---

## Jenkins me Job ke types

### 1\. Freestyle Job

Ye Jenkins ka **basic job type** hai.

Use cases:

* Simple build
    
* Shell script run karna
    
* Small automation
    

Features:

* UI based configuration
    
* Easy for beginners
    
* Limited flexibility
    

Example:

* Git repo clone
    
* `mvn clean install`
    
* `java -jar app.jar`
    

---

### 2\. Pipeline Job

Ye **modern aur recommended** job type hai.

Isme pipeline code ke form me hoti hai (Jenkinsfile).

Features:

* Pipeline as code
    
* Version control friendly
    
* Complex CI/CD possible
    

Example stages:

* Build
    
* Test
    
* Package
    
* Deploy
    

---

### 3\. Multibranch Pipeline Job

Is job type me Jenkins:

* Har branch ke liye alag pipeline banata hai
    
* Jenkinsfile automatically detect karta hai
    

Best for:

* Real-world projects
    
* Git-based workflows
    

---

### 4\. Folder Job

Ye actual job nahi, balki **jobs ko organize** karne ke liye hota hai.

Use:

* Team-wise jobs
    
* Project-wise jobs
    

---

## Jenkins Job trigger types

Jenkins job ko hum kai tariko se run kar sakte hain:

* Manual trigger
    
* Git webhook (code push)
    
* Scheduled time (cron)
    
* Another job ke baad
    

Example cron:

```plaintext
H/5 * * * *
```

---

## Jenkins Job configuration ke main parts

### Source Code Management

* GitHub / GitLab repo
    
* Branch selection
    

### Build Triggers

* Webhook
    
* Poll SCM
    
* Schedule
    

### Build Steps

* Shell scripts
    
* Maven / Gradle
    
* Docker commands
    

### Post-build Actions

* Email notification
    
* Artifact upload
    
* Deployment
    

---

## Jenkins Job vs Jenkins Pipeline

| Jenkins Job | Jenkins Pipeline |
| --- | --- |
| UI based | Code based |
| Less flexible | Highly flexible |
| Beginner friendly | Production ready |
| Manual changes | Version controlled |

Aaj ke time me **Pipeline jobs preferred** hote hain.

---

## DevOps me Jenkins Job ka importance

DevOps me Jenkins job:

* CI process automate karta hai
    
* CD process control karta hai
    
* Human error kam karta hai
    
* Fast delivery enable karta hai
    

Without jobs, Jenkins ka koi use nahi hota.

---

## Real-world example

Ek Jenkins job:

* GitHub se code uthata hai
    
* Maven se build karta hai
    
* Docker image banata hai
    
* Kubernetes me deploy karta hai
    

Sab kuch automatically.

---

## Interview-ready definition

> Jenkins Job is a configured task in Jenkins that automates build, test, and deployment processes as part of CI/CD.
