Skip to content

Jenkins

Jenkins is an open-source automation server that provides a platform for continuous integration and continuous delivery (CI/CD) pipelines. Jenkins allows users to automate the building, testing, and deployment of software.

Installation

To install Jenkins, follow these steps:

  1. Install Java 8 or higher.
  2. Download the Jenkins WAR file from the Jenkins website.
  3. Run the following command to start Jenkins: java -jar jenkins.war
  4. Open a web browser and navigate to http://localhost:8080.

Configuration

Jenkins can be configured using the web interface. The following configurations can be set:

  • Manage Jenkins: Configures global settings for Jenkins.
  • Configure System: Configures system-level settings.
  • Configure Global Security: Configures security settings.
  • Manage Nodes: Configures nodes, which are the agents that execute builds.
  • Credentials: Configures credentials used to access external systems.

Jobs

Jobs are the building blocks of Jenkins. Jobs are defined using XML or using the web interface. The following types of jobs can be created:

  • Freestyle project: A simple job that executes a set of build steps.
  • Pipeline: A job that defines a pipeline of build steps.
  • Multibranch pipeline: A job that builds branches of a Git repository.
  • GitHub organization: A job that builds repositories within a GitHub organization.

Build Steps

Build steps are the individual tasks that are executed as part of a job. Jenkins supports many build steps, including:

  • Execute shell: Executes a shell script.
  • Execute Windows batch command: Executes a Windows batch command.
  • Invoke Gradle script: Executes a Gradle script.
  • Invoke Ant: Executes an Ant script.
  • Invoke Maven: Executes a Maven build.
  • Publish JUnit test result report: Publishes JUnit test results.

Plugins

Plugins extend the functionality of Jenkins. Jenkins has a large number of plugins available that can be installed and configured using the web interface. Some commonly used plugins include:

  • Git: Integrates with Git repositories.
  • GitHub: Integrates with GitHub repositories.
  • Pipeline: Adds support for pipeline jobs.
  • JUnit: Provides support for JUnit testing.
  • Cobertura: Provides support for code coverage testing.
  • Email Extension: Adds support for sending email notifications.

Agents

Agents are the workers that execute builds. Jenkins supports several types of agents, including:

  • Jenkins agent: A node that is part of the Jenkins installation.
  • Docker agent: A node that runs inside a Docker container.
  • SSH agent: A node that is accessed using SSH.