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
Download and install Java JDK 11 or later.
Verify installation:
java -version
Step 2: Download and Install Jenkins
Download Jenkins from Jenkins official website.
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
Open a browser and go to:
http://localhost:8080
Retrieve the initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Paste the password in the browser prompt.
3. Configuring Jenkins for First Use
Step 1: Initial Setup
After logging in, Jenkins will prompt for plugin installation.
Select "Install suggested plugins".
Create an admin user with username, password, and email.
Step 2: Configure System Settings
Navigate to Manage Jenkins > Configure System.
Set up system-wide configurations such as Java path and build tool paths.
Step 3: Configure Nodes (Optional)
Go to Manage Jenkins > Manage Nodes and Clouds.
Add and configure additional agent nodes.
Step 4: Verify Installation
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.
Check the build logs for output.
Comments
Post a Comment