Exercise-5

5. Introduction to Jenkins: What is Jenkins?, Installing Jenkins on Local or Cloud Environment, Configuring Jenkins for First Use

1. Introduction to Jenkins

Jenkins is an open-source automation server used for Continuous Integration and Continuous Deployment (CI/CD). It allows developers to automate repetitive tasks such as building, testing, and deploying software efficiently.

1.1 Features of Jenkins

  • Open-source and widely used for CI/CD.

  • Supports plugins for extensibility.

  • Works with various build tools like Maven and Gradle.

  • Can be deployed on local machines or cloud environments.

  • Provides a web-based GUI for easy management.

  • Allows job scheduling and pipeline execution.

1.2 Jenkins Architecture

  • Master Node: Manages Jenkins configurations and distributes workloads to agents.

  • Agent Node: Executes assigned jobs.

  • Plugins: Extend Jenkins functionality.

  • Pipelines: Define CI/CD workflows.

Video Tutorial:


2. Installing Jenkins on Local or Cloud Environment

2.1 Prerequisites

  • Java (JDK 11 or newer)

  • System requirements: Minimum 1GB RAM, 1GHz CPU

  • Internet connection for downloading Jenkins and dependencies

2.2 Installing Jenkins on Local Machine (Windows/Linux/Mac)

Step 1: Install Java

  1. Download and install Java JDK 11 or later.

  2. Verify installation:

    java -version

Step 2: Download and Install Jenkins

  1. Download Jenkins from Jenkins official website.

  2. Install Jenkins based on OS:

    • Windows: Run the .msi installer and follow the setup wizard.

Step 3: Start Jenkins

  • Windows: Jenkins runs as a Windows service

Step 4: Access Jenkins Web Interface

  1. Open a browser and go to:

    http://localhost:8080
  2. Retrieve the initial admin password:

    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  3. Paste the password in the browser prompt.


3. Configuring Jenkins for First Use

Step 1: Initial Setup

  1. After logging in, Jenkins will prompt for plugin installation.

  2. Select "Install suggested plugins".

  3. Create an admin user with username, password, and email.

Step 2: Configure System Settings

  1. Navigate to Manage Jenkins > Configure System.

  2. Set up system-wide configurations such as Java path and build tool paths.

Step 3: Configure Nodes (Optional)

  1. Go to Manage Jenkins > Manage Nodes and Clouds.

  2. Add and configure additional agent nodes.

Step 4: Verify Installation

  1. Create a sample job:

    • Go to New Item > Freestyle project.

    • Add a build step (e.g., Execute shell command echo "Hello Jenkins").

    • Click Save and Build Now.

  2. Check the build logs for output.

Comments