0% found this document useful (0 votes)
15 views

eBook_.NET_4_L3_Automation_Testing_with_Jenkins

Uploaded by

Arkadeep Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

eBook_.NET_4_L3_Automation_Testing_with_Jenkins

Uploaded by

Arkadeep Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Automation Testing with Jenkins

You Already Know

Course(s):

Jenkins Continuous Integration & DevOps with Java and


.NET
▪ Get started with continuous integration
- What is continuous integration (CI)?
- Why continuous integration (CI)?
- How to implement CI?

▪ Set up and configure Jenkins


- What is Jenkins
- Jenkins features
- Install Jenkins server (Windows, Linux, and Mac)
- Jenkins set up

▪ Demonstrate how to use .NET with Jenkins


- .NET project: How it works
- .NET project: How to integrate it with CI
A Day in the Life of a .NET Full Stack Developer

Joe has successfully completed the previous tasks and now he has
been asked to implement his knowledge about Jenkins.

A Pizza place is in the middle of creating prototypes for their new


website. Everyday a new build is created and deployed for review.
Joe’s manager has asked him to automate the process of generating
new build and deploying it for the review.

In this lesson, we will learn how to solve this real-world scenario to


help Joe complete his task effectively and quickly.
Learning Objectives

By the end of this lesson, you will be able to:

Install, configure, and set up Jenkins and associated plug-ins

Enable security in Jenkins

Outline the process of creating a build project, integrating the


project with Jenkins, and triggering the build

Explain how automatic builds and Cron jobs are scheduled


Setting Up Jenkins

Duration: 90 min.

Problem Statement:
Demonstrate the Jenkins set up.
Assisted Practice: Guidelines to Set Up Jenkins

1. Setup Jenkins in Windows 10.


2. Install the required plugins.
3. Push the code to your GitHub repositories.
Jenkins Security
Jenkins Security

Jenkins offers numerous options to enable, edit, and disable various security features.

Best Practice Secure Jenkins before configuring global security

Features of Jenkins security:

Ensures all users are authenticated before they can access Jenkins
Access Control
environment

Authorization Ensures all activities by the users are authorized and are aligned with
Control the appropriate set of permissions

External threat Ensures that the users and their activities are protected against
Control external threats
Access Control

Access control is the primary mechanism to secure Jenkins environment against unauthorized usage.

Access
Control

Security Realm Authorization

Determines what each user is


Determines who is allowed access
allowed to perform
Enable Security

Steps to enable security in Jenkins:

Deploy
Choose Set up other
Jenkins.war file Configure Set up security
users and
and start the Global Security realm
authorizations
server

1 2 3 4 5 6 7 8

Click Manage
Select Enable
Jenkins on Add the first Once done,
Security
Jenkins home user (Admin) click Save
checkbox
page
Authorization Levels

Authorization levels indicate what the users can access in the Jenkins environment.

Authorization Level Description

Anyone can do anything All users, including anonymous users have full control.

Similar to Jenkins<1.164 The admin users are granted


Legacy mode full access and other users are granted read access.

Logged in users can do anything All the logged-in users get full access and anonymous
users get read or no access.

Matrix-based security Allows granular control and defines the users with
their specific actions.
Administrator User
Steps to create an administrator user:

Login to Jenkins Select Create User.


Navigate to Manage
using an existing Enter the username,
Jenkins and then
administrative user password, and email
Manage Users page.
credentials. address. Click Save.

In the User/group
On Manage Jenkins Under Authorization,
field, enter the new
page, click Configure select Matrix-based
administrative user
Global Security. security.
credentials.

Enable all the


Click on Save to
privileges for this
apply changes.
user.
Create a New Jenkins Build Project

Duration: 20 min.

Problem Statement:
Demonstrate the creation of a new build project.
Assisted Practice: Guidelines to Create a New Build Project

1. Login to Jenkins dashboard.


2. Set up a .NET build project in Jenkins.
3. Push the code to your GitHub repositories.
Continuous Integration with Jenkins

Duration: 20 min.

Problem Statement:
Demonstrate continuous integration with Jenkins
Assisted Practice: Guidelines for Continuous Integration with Jenkins

1. Login to Jenkins dashboard.


2. Set up a .NET build project in Jenkins for continuous integration.
3. Push the code to your GitHub repositories.
Triggering the Build

Duration: 20 min.

Problem Statement:
Demonstrate the trigger of a build.
Assisted Practice: Guidelines to Trigger a Build

1. Login to Jenkins dashboard.


2. Set up a .NET build project in Jenkins for continuous integration.
3. Trigger the build in Jenkins.
4. Push the code to your GitHub repositories.
Schedule Automatic Builds and Cron Jobs

Duration: 20 min.

Problem Statement:
Demonstrate scheduling of automatic builds and Cron jobs.
Assisted Practice: Guidelines to Schedule Automatic Builds and Cron Jobs

1. Set up Jenkins in Windows 10.

2. Set up a .NET build project in Jenkins.

3. Set up a schedule to generate a build.

4. Set up a recurring schedule in Cron format.

5. Push the code to your GitHub repositories.


Key Takeaways

Jenkins is an open source automation tool with numerous


plug-ins.

Jenkins provides many configuration options to enable, edit,


and disable various security features.

Access control is the primary mechanism to secure the


Jenkins environment against unauthorized usage.

Authorization levels determine what the users can access in


the Jenkins environment.
Set up a .NET Web Application to Be Deployed via Jenkins

Duration: 30 min.
Problem Statement:

Joe's Pizza place is in the middle of creating prototypes for their new
website. Everyday a new build is created and deployed for review.
Automate the whole process of generating a new build and deploying it for
review using Jenkins.

Perform the following:

● Install and setup Jenkins.


● Create a .NET web application in Visual Studio with a sample homepage
with dummy content as a placeholder.
● Set up a Job in Jenkins to automatically build and deploy the web
application at a certain time daily.
Before the Next Class
Course:
1. Docker for the Absolute Beginner Hands-On
2. Develop and Deploy Modern Web Applications with Docker

You should be able to:


▪ Set up and install Docker
▪ Demonstrate Docker commands
▪ Demonstrate Docker Run, Docker Images, Docker Compose, and
Docker Swarm
▪ Containerize your application
▪ Perform Docker Container Management

You might also like