Ravindra BagaleCourses & study guides Track your progress

Guides

नवशिक्यांसाठी Jenkins Pipeline

Read this guide in: English · मराठी · हिंदी

Why Jenkins Pipeline हवा आहे? कारण कंपनी CI स्वतःच्या server वर चालवते तेव्हा developers आणि operations मध्ये problem येतो. Developers ला automatic checks हवेत. Operations — server side — अनेकदा Jenkins controller own करतो. Jenkinsfile stages code म्हणून सांगतो: checkout, steps, early fail — मग Build Now आणि Console Output वाचा.

मित्रांनो, कंपनी स्वतःचा CI server चालवते तर Jenkins येतो. आधी “माझ्या machine वर चालवा” ची fight पहा.

थोडक्यात उत्तर

हे पाच पॉइंट्स लक्षात ठेवा:

  1. Developer — app शेजारी pipeline-as-code हवा.
  2. Operations — server-side person जो अनेकदा Jenkins administer करतो.
  3. Problem — manual builds / “माझ्या machine वर चालवा” / shared console log नाही.
  4. Jenkins Pipeline — Declarative Jenkinsfile + Build Now.
  5. लक्षात ठेवा: stages → Build Now → console वाचा.

Language: English · मराठी · हिंदी

Problem? Suppose we are…

Suppose we are building Instagram (like updates)

प्रत्येक profile change “ज्याला आठवते त्या local script” ने build. Production तुटले की Operations कडे Jenkins history नाही.

Suppose we are working at Netflix and we are giving updates

वारंवार updates — प्रत्येक वेळी तोच stages हवा. Declarative pipeline = checklist as code.

Suppose you are working in Infosys on a client project

Client चा operations team आधीच Jenkins चालवतो. तुमचे काम: Pipeline job + audit होणारा Jenkinsfile — फक्त तुमच्या laptop वरची सवय नाही.

Lab Jenkins वापरा; नसलेले servers scan करू नका. Compare: GitHub Actions.

GitHub Actions CI pipeline on every push A git push starts a workflow from .yml: checkout the repo, run job steps on a runner, then report pass or fail. git push to main Workflow ci.yml on: push Job · runner 1. checkout 2. ls / test 3. report Result ✓ pass / fail CI proof before deploy Diagram of the YAML idea — no live GitHub login required to learn the shape

A git push starts a workflow from .yml: checkout on a runner, run steps, report pass or fail.

Jenkins कसे उत्तर देते

pipeline {
  agent any
  stages {
    stage('Checkout') {
      steps { checkout scm }
    }
    stage('Check') {
      steps { sh 'ls -la' }
    }
  }
}
  1. Jenkins उघडा, sign in.
  2. New Item → Pipeline → OK.
  3. Pipeline script paste किंवा Pipeline script from SCM.
  4. Build Now → Console Output.
  5. एकदा fail check; red log शिका.
  6. Jenkinsfile app code शेजारी ठेवा.

Ravindra Bagale's Tip

पहिल्या दिवशी वीस plugins install करून controller तोडू नका. समजलेल्या sh steps सह Declarative. Stable > fancy. लक्षात ठेवा.

समजलं का? Why Jenkins = company-owned CI जिथे operations आणि developers Console Output शेअर करतात; Instagram / Netflix / Infosys “suppose”; Jenkinsfile = pipeline as code.

Frequently asked questions

What is Jenkins?

An open-source automation server commonly used for CI/CD pipelines.

What is a Jenkinsfile?

A text file (usually in Git) that defines the Pipeline as code.

Declarative vs Scripted?

Declarative pipeline { } is the beginner-friendly syntax. Scripted is more Groovy-heavy.

Jenkins vs GitHub Actions?

Actions lives inside GitHub. Jenkins is a separate server you operate — useful in many companies.

What is an agent?

Where the stages run — built-in node or a labelled worker.

Is Jenkins only for Java?

No. Pipelines can run shell, Docker, Node, Python and more.