Practice Exercise 1: Different Functionalities of Jenkins
Objective
In this lab exercise, you will get hands-on experience with various functionalities of Jenkins, a popular open-source automation server. You will learn how to create and configure jobs, use plugins, and set up basic automation tasks.
Prerequisites
- Jenkins installed and running.
- Access your lab instance by following the instructions in accessing your Lab Environment.
Access Jenkins
-
Get the ip address of your lab instance.
-
Open your web browser and navigate to http://your_lab_ip:8080.
-
Your login name is the letter of your first name (second name not included) and your lastname (i.e. Mark Jimmy Santos = msantos). Password is the same as the password provided by your instructor.
Duration: 60 minutes
Tasks
Important Notes
:
-
Always take a screenshot and copy the build url.
-
Use this form to upload your screenshots and build urls.
Task 1: Create a Freestyle Project
-
Log in to your Jenkins instance ( see instructions above ).
-
Click on "New Item" to create a new project.
-
Input item name ( ex. task1-lastname )
-
Select "Freestyle Project." Click Ok.
-
Configure the project with a simple build step ( (e.g., "Execute shell" on Unix or "Execute Windows batch command" on Windows). )
-
Write a simple print command to see the output. ( ex. echo "Hello World!"). Save.
-
Save the project and trigger a build.
-
Provide a screenshot and the build url.
Task 2: Install and Use a Plugin
-
Go to the Jenkins dashboard.
-
Click on "Manage Jenkins" > "Manage Plugins."
-
Install a plugin of your choice. (e.g., "GitHub Integration," "Docker," or any other plugin that interests you).
-
Configure the plugin according to your needs.
-
Create a job that uses the installed plugin. For example, if you installed the GitHub Integration plugin, create a job that triggers builds on code commits.
-
Save the project ( ex. task2-lastname ).
-
Provide a screenshot and the build url.
Task 3: Configure Job Build Triggers
-
Open one of your previously created jobs.
-
Configure build triggers. For example, set up a periodic build trigger, or configure the job to build when other jobs complete.
-
Test the build trigger by making changes that should initiate a build.
-
Provide a screenshot and the build url.
Task 4: Explore Jenkins Security
-
Go to "Manage Jenkins" > "Configure Global Security."
-
Configure security settings (e.g., enable security, create users, or configure permissions).
-
Test user authentication and authorization by restricting access to certain jobs.
-
Provide a screenshot and errors showing restricted access
Task 5: View Build Logs and Console Output
-
Open a job /project named
BuildLogsTask
. Run a new build. -
Examine the build logs and console output to understand how to troubleshoot build failures.
-
Fix the error and make sure that the run is successful.
-
Provide a screenshot and the build url.
Conclusion
In this lab exercise, you have explored various functionalities of Jenkins, including creating different types of jobs, using plugins, configuring build triggers, setting up security, monitoring Jenkins, and automating testing. Jenkins is a versatile tool with a wide range of capabilities that can help streamline your software development and deployment processes.