Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 40 ยท Meet Jenkins

What Is Jenkins?

Learn what continuous integration and delivery are, what a CI server does, where Jenkins came from, how it compares with GitHub Actions and GitLab CI, and when to pick it.

Imagine a team of five developers who each work on the same project for two weeks and then try to combine everything on Friday. The merge is a mess, nobody knows which change broke the tests, and the release slips. Continuous integration (CI) is the habit that prevents this: everyone merges small changes into a shared branch many times a day, and every merge is built and tested automatically within minutes.

Jenkins is one of the most widely used tools for doing that automatic work. It is an open-source automation server written in Java. You tell it when to run (a push, a schedule, a button), what to run (compile, test, package, deploy) and where to run it, and it records the result of every run. In this lesson you will learn what CI and CD mean, what a CI server actually does, where Jenkins came from, and when it is the right choice.

What a CI server does

Watches Notices new commits or a schedule.
Builds Compiles and packages the code.
Tests Runs checks on every change.
Reports Tells the team pass or fail.

The same steps run the same way every time, on a machine that is not yours.

1 / 2

CI, continuous delivery and continuous deployment

The abbreviation CI/CD hides three different ideas:

  • Continuous integration is about the code. Changes are merged frequently and each merge triggers an automatic build and test run. The goal is fast feedback: you learn within minutes that you broke something, while the change is still fresh in your mind.
  • Continuous delivery extends the pipeline so that every build that passes is a releasable artifact. A person still decides when to release, usually with an approval click.
  • Continuous deployment removes that click: every build that passes all checks goes to production by itself.

Most teams start with CI, add delivery later, and only some adopt full deployment. Jenkins supports all three, because it simply runs whatever steps you describe. You will build deployment pipelines in Deployment Pipelines and Approvals.

What a CI server does all day

A CI server is a small, reliable robot with a to-do list. In a typical loop:

  1. Detect a trigger: a commit arrives (via a webhook from your Git host), a timer fires, or somebody presses "Build now".
  2. Allocate a machine: find a free worker that matches what the job needs (for example "Linux with Java 21").
  3. Fetch the code into a clean folder called a workspace.
  4. Run the steps: build, test, package, scan.
  5. Record the outcome: build number, status, duration, console log, test results, and any files worth keeping (artifacts).
  6. Notify: show a colour on the dashboard, send an email or a chat message.

The value is not any single step; you could run all of them by hand. The value is that they run the same way every time, on a shared machine, for every change, and the history is kept. "It works on my laptop" stops being an argument.

A tiny stand-in for the loop

Jenkins itself is a server that you install and run, so it cannot run in this page. The editor below is a stand-in: a few lines of JavaScript that model the trigger loop. It is not Jenkins code, only the idea. Commits arrive, each one becomes a numbered build, and a build fails when the commit message contains the word "broken".

JS A stand-in build trigger loop

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice what the history gives you for free: you can see that build #2 is the first red one and who triggered it, and that #3 fixed it. That traceability is the heart of CI.

Where Jenkins came from

Jenkins began as Hudson, a project started by Kohsuke Kawaguchi at Sun Microsystems in the mid-2000s. After Oracle acquired Sun, a disagreement over the project's governance led the community to fork it in 2011 under the new name Jenkins. It later joined the Continuous Delivery Foundation, which hosts it today.

Two ideas explain Jenkins' long life:

  • Plugins. The core is small. Git support, Docker, notifications, test reports, cloud agents and much more come as plugins, and there are well over a thousand of them. You can make Jenkins fit almost any toolchain.
  • Pipeline as code. Since version 2, you can describe a whole build in a text file called a Jenkinsfile that lives next to your source code. We start on it in Pipeline Basics and the Jenkinsfile.

The flexibility has a price: you run the server yourself. You apply updates, manage plugins, secure it and give it machines to work on. We cover those duties in the later chapters.

The alternatives

Jenkins is not the only choice, and you should know the landscape.

Tool Where it runs Typical style
Jenkins Your own servers or cloud machines Self-hosted, huge plugin ecosystem, Groovy-based pipelines
GitHub Actions GitHub's hosted runners, or your own YAML workflows stored in .github/workflows, tightly tied to GitHub
GitLab CI/CD GitLab's runners, or your own YAML in .gitlab-ci.yml, built into GitLab
CircleCI, Buildkite, Azure Pipelines and others Hosted or hybrid YAML pipelines, different pricing and strengths

You can compare Actions in detail in GitHub Actions and in Jenkins vs GitHub Actions, GitLab CI and Others.

When to choose Jenkins

Jenkins is a strong fit when:

  • You must run builds on your own infrastructure (security rules, data location, special hardware such as test devices or big build machines).
  • Your toolchain is unusual or old, and a plugin or a custom script is the quickest way to integrate it.
  • You have many repositories on many Git hosts and want one place that builds them all.
  • Your organisation already has Jenkins and the skills to run it.

It is a weaker fit when you are a small team on GitHub or GitLab with ordinary needs; the built-in CI of those platforms means no server to look after. Neither answer is "right" for everybody. Many companies run both.

Throughout this track, the commands, Jenkinsfiles and screens are shown as read-only code, because the real Jenkins server cannot run in a web page. The runnable editors are small stand-ins written in JavaScript that model how a feature works, and each lesson says which is which.

Words you will meet

  • Job (or project): a named description of work to run.
  • Build: one run of a job, with its own number, log and result.
  • Pipeline: a job defined as code, made of stages.
  • Agent (formerly "slave"): a machine that runs builds.
  • Artifact: a file produced by a build that you want to keep, such as a JAR or a ZIP.
  • Plugin: an add-on that extends Jenkins.

The next lesson shows how these pieces fit together inside Jenkins.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main goal of continuous integration?

    CI is about frequent merges plus automatic build and test runs, so problems are found within minutes.
  2. 2. What separates continuous delivery from continuous deployment?

    Both keep builds releasable. Continuous delivery waits for a human decision, continuous deployment releases every passing build.
  3. 3. Why did Jenkins get its name?

    After a governance dispute following Oracle's acquisition of Sun, the community forked Hudson and called the fork Jenkins.
  4. 4. Which situation points most strongly towards Jenkins rather than a hosted CI service?

    Jenkins shines when you need control over where builds run and what they use. The price is that you operate the server yourself.

Summary

  • CI means merging often and building and testing each merge automatically; delivery and deployment extend the pipeline towards release.
  • A CI server detects triggers, finds a machine, fetches code, runs steps, records results and notifies people.
  • Jenkins is an open-source automation server, forked from Hudson in 2011, extended through plugins and described as code in a Jenkinsfile.
  • GitHub Actions, GitLab CI and others are hosted alternatives; Jenkins wins on control and flexibility, loses on upkeep.
  • You will meet the terms job, build, pipeline, agent, artifact and plugin throughout the track.

Next, look inside the server in Jenkins Architecture: Controller, Agents and Executors.