Day 51 of 90 Days of DevOps Challenge: First Jenkins Project – Hello World with GitHub Integration

Vaishnavi DVaishnavi D
2 min read

Yesterday, I explored the architecture of Jenkins, diving into the Master-Agent model and understanding how Jenkins enables scalable CI/CD pipelines. I also learned how plugins extend Jenkins' functionality and how agents help in distributing workloads.

Today, I created my first Jenkins Freestyle Job that pulls code from GitHub, runs a shell script, and supports manual or automatic triggers using Poll SCM and webhooks—covering the basics of SCM integration, build triggers, and shell execution.

My First Jenkins Job

Step 1: Creating a Freestyle Job

  • From Jenkins Dashboard → “New Item”

  • Name it hello-world-job

  • Select the Freestyle project

  • Click OK to configure it

Step 2: Source Code Management – GitHub Integration

I connected Jenkins to a GitHub repository by:

  • Go to the Source Code Management section

  • Select Git

  • Enter the repo URL

  • Add credentials if the repo is private

This allows Jenkins to clone my repo whenever a build is triggered

Step 3: Build Triggers – When Should Jenkins Run?

I explored 3 types of triggers:

  1. Manual Trigger

    • Click "Build Now" in Jenkins UI whenever I want to run the job
  2. Poll SCM

    • Jenkins checks the GitHub repo periodically for changes

    • I used cron syntax:
      H/2 * * * * → Polls every 2 minutes

  3. GitHub Webhook (Advanced)

    • Configured a webhook in GitHub → Settings → Webhooks

    • Jenkins URL: http://<jenkins-server>:8080/github-webhook/

    • Whenever I pushed code, Jenkins automatically triggered the build

I used Poll SCM today for testing but will experiment more with webhooks tomorrow.

Step 4: Running a Shell Command

In the Build section, I added a simple shell command:

echo "=== Hello from Jenkins ==="
echo "Listing project files:"
ls -la

This simulated a real build step. Jenkins pulled the repo and printed output to the console.

Sample Output:

=== Hello from Jenkins ===
Listing project files:
total 12
drwxr-xr-x 2 jenkins jenkins 4096 ...
-rw-r--r-- 1 jenkins jenkins  123 README.md

Final Outcome

My first Jenkins job was successful!

  • Jenkins cloned the code from GitHub

  • Ran a shell command

  • Got triggered manually or via SCM polling

I now understand how Jenkins integrates with Git and starts automating basic tasks.

Final Thoughts:

This was a huge confidence boost!
Even though it was a simple "Hello World" job, I now understand the core Jenkins job lifecycle from source code connection to build triggers and execution.

Tomorrow, I’ll explore Jenkins Pipelines using Jenkins file to define CI/CD as code

Stay tuned for Day 52!

0
Subscribe to my newsletter

Read articles from Vaishnavi D directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vaishnavi D
Vaishnavi D