Jenkins Assignment
Jenkins Day -1
### Topic 1: Set Up Jenkins on an EC2 Instance (Amazon Linux 2)
### Topic 2: Check the Jenkins Port.
### Topic 3: Add the Port to Security Group.
### Topic 4: Check the Home Directory.
### Topic 5: Post-Install Task.
### Topic 6: Create a Freestyle Job.
### Topic 7: Find the Workspace Location.
### Topic 8: Check the Console Output.
### TOPIC 9: Procedure to Change Jenkins Port to 8081.
#### TOPIC 10: Create Users in Jenkins.
#### TOPIC 11: Configure Matrix-Based Authorization.
#### TOPIC 12: Project for practicing matrix-based authorization for a regular user.
Jenkins-Day-2
### Project Scenario: Configuring Jenkins with Role-Based Authorization with Global Roles and Validating with a Sample Job
Install Required Plugins
Configure Role-Based Authorization Strategy with Global Roles
Create Users and Assign Global Roles
Create a Sample Project and Job
Validation
### Project Scenario: Creating and Assigning Item Roles in Jenkins with a Validation Job
Set Up Jenkins and Enable Role-Based Authorization
Create Users
Install the Role-Based Authorization Strategy Plugin (If Not Already Installed)
Create and Define Item Roles
Create a Sample Project and Job
Assign Users to Item Roles
Validation
### Project Scenario: Configuring Jenkins with Project-Based Matrix Authorization Strategy and Build Triggers
Set Up Jenkins and Enable Project-Based Matrix Authorization Strategy
Create Users
Create a New Project
Configure a Sample Job with Build Triggers
Validation
### Project Scenario: Configuring Jenkins with Poll SCM Build Triggers
Set Up Jenkins Project
Configure Source Code Management (SCM)
Set Up Poll SCM Build Trigger
Add a Build Step
Save and Build
### Difference between poll SCM and Webhook
### Project Scenario: Configuring Jenkins with Webhook Build Triggers
Set Up Jenkins Project
Configure Source Code Management (SCM)
Set Up Webhook in GitHub
Add a Build Step
Validate Webhook Configuration
Jenkins-Day-3
### Project: Installing Maven with YUM, Compatible Java Version, and Configuring JAVA_HOME on Amazon Linux
Install a Compatible Java Version
Install Apache Maven Using YUM
Configure the JAVA_HOME Environment Variable
### Simple Project: Cloning a GitHub Repository, Compiling, Unit Testing, and Packaging on Amazon Linux
Launch and Access the EC2 Instance
Install Required Tools
Clone the GitHub Repository
Compile the Project
Run Unit Tests
Package the Application
Verify the Process
Clean Up (Optional)
### Simple Project: Configuring a Freestyle Job to Compile Java Code from GitHub with Automatic Maven Installer and Manually Set Java Path on Jenkins GUI
Configure Jenkins for Java and Maven
Create and Configure the Jenkins Freestyle Job
Build and Validate the Job
Jenkins-Day-4
### Project: Running Maven Tests and Validation on Jenkins GUI
Create a New Jenkins Freestyle Project
Configure Source Code Management
Add Maven as a Build Tool
Configure Java Path Manually
Save and Run the Job
Validate Test Results
### Project: Installing Jenkins JUnit Plugin and Publishing Test Reports
Install the JUnit Plugin
Create a New Jenkins Freestyle Project
Configure Source Code Management
Add a Build Step to Run Maven Tests
Configure Post-Build Action to Publish JUnit Test Results
Save and Run the Job
Validate the Published Test Reports
### Project: Configuring Maven Package Goal in Jenkins GUI with Validation
Create a New Jenkins Freestyle Project
Configure Source Code Management
Add a Build Step to Run Maven Package
Save and Run the Job
Validate the Package Output
Inspect the Build Logs
### Project: Configuring Jenkins with Build Pipeline Plugin, Build Triggers, and Post-Build Actions for Compile, Unit Test, and Package
Install the Build Pipeline Plugin
Create a New Jenkins Freestyle Project
Configure Source Code Management
Add a Build Trigger
Add a Build Step to Compile the Code
Add a Build Step to Run Unit Tests
Add a Build Step to Package the Application
Add a Post-Build Action to Publish Test Results
Save and Run the Job
Validate the Build Outputs
Create a New Build Pipeline View
Inspect the Pipeline and Validate
### Project: Password-less SSH Configuration Between Master and Slave
Switch to Root User on Both Servers
Create `user1` on Both Master and Slave Servers
Set Password for `user1` on Both Servers
Enable `PasswordAuthentication` on Slave Server
Generate SSH Key Pair for `user1` on Master Server
Copy the SSH Public Key to the Slave Server
Test SSH Connection from Master to Slave for `user1`
### Project: Prepare and Add Node as Jenkins Slave with Configuration
Install Git
Install Java
Set JAVA_HOME Directory
Install Maven
Add a New Node to Jenkins Master
Validation
### Project: Add a Job on Jenkins Slave Node (Label: `slave-node`) to Run Maven Compile Job Without Poll SCM
Add a New Maven Compile Job on Jenkins
Configure Source Code Management
Configure Build Step for Maven Compilation
Save the Job
Manually Trigger and Validate the Maven Compile Job
Validate Execution on Slave Node
Jenkins-Day-5
### Project: Configuring Pipeline as Code in Jenkins GUI
Search for Pipeline Plugin
Install Plugin: Pipeline Multibranch & Pipeline stage View
Create a Job with Pipeline Type
Create a Pipeline Script
Run the Pipeline Job
Validate the Pipeline Execution
### Project: Jenkins Pipeline with "Pipeline Script from SCM"
Create a New Jenkins Pipeline Job
Configure the Pipeline to Use "Pipeline Script from SCM"
Set Up GitHub Repository Details
Configure the Branch and Jenkinsfile Path
Configure Build Triggers (Optional)
Save the Job
Run the Pipeline Job
Validate the Pipeline Execution
### Project: Jenkins Pipeline with Git Branch and Parameters
Create a New Git Branch (`feature/devops_1`)
Create the Jenkinsfile with 3 Stages and Parameters
Push the Changes to GitHub (`feature/devops_1`)
Create a New Jenkins Pipeline with "Pipeline Script from SCM"
Build the Pipeline
Validate the Build Stages
###line-by-line explanation of the code from the `Jenkinsfile`:
project outline for creating a Jenkins pipeline that uses "Pipeline script from SCM" with conditions based on selected environments:
### Project: Environment-Based Jenkins Pipeline
Create a Git Repository:
Create a Jenkinsfile:
Push the Jenkinsfile to GitHub:
Create a New Pipeline Job in Jenkins:
Configure the Pipeline Job:
Run the Job:
Validate the Output:
### create a Jenkins pipeline with "pipeline script from SCM" using "when" and "input" directives. The pipeline will ask for input to choose between Production, Development, or Test environments and display a corresponding message for the selected environment.
Create a Git Branch & Clone Repository
Create a Jenkinsfile
Push Jenkinsfile to GitHub
Create Jenkins Pipeline Job Using "Pipeline Script from SCM"
Run the Pipeline
Validate the Output
###Explanation of each line of the provided Jenkins pipeline script