Вы находитесь на странице: 1из 11

Table of Contents

1. INTRODUCTION ...................................................................................................................................... 3
WHAT IS JENKINS?.................................................................................................................................................... 3
2. INSTALLATION AND SETUP ..................................................................................................................... 4
DOWNLOAD JENKINS................................................................................................................................................. 4
3. CREATING NEW ITEM ............................................................................................................................ 5
4. USERS ..................................................................................................................................................... 7
4.1. CREATING A USER ........................................................................................................................................ 7
4.2. CONFIGURING USERS ................................................................................................................................... 8
4.3. CONFIGURING ROLES AND STRATEGIES ............................................................................................................ 9
4.3.1. Downloading Role based Authorization plugin ................................................................................ 9
4.3.2. Managing Jenkins-Configuring global security................................................................................. 9
4.3.3. Assigning Roles ................................................................................................................................. 9
5. MANAGE JENKINS ................................................................................................................................. 11
5.1. CONFIGURING SYSTEMS .................................................................................................................................... 11
1. INTRODUCTION
WHAT IS JENKINS?
Jenkins is a self-contained, open source automation server which can be used to automate
all sorts of tasks related to building, testing, and delivering or deploying software.

Jenkins can be installed through native system packages, Docker, or even run standalone by
any machine with a Java Runtime Environment (JRE) installed.
2. INSTALLATION AND SETUP
DOWNLOAD JENKINS
 The official website for Jenkins is https://jenkins-ci.org/. If you click the given link,
you can get the Jenkins.msi
 By default Jenkins will be installed in the port 8080.
 Once Jenkins is up and running, one can access Jenkins from the link –
http://localhost:8080
 You can just install the file like exe file and follow the instructions given to create a
password.
 Go to this location in your pc
C:\ProgramFiles(x86)\Jenkins\secrets\initialAdminPassword
 This link will bring up the Jenkins dashboard.

To initialize jenkins from command prompt go to the folder where jenkins.war is present
and open command prompt and type java –jar jenkins.war

To start the jenkins on different port


java –jar jenkins.war –httpPort=9091
3. CREATING NEW ITEM
Click on new item give any name and select free style project click ok.

Then go to project and click on configure and in general section click on advanced select use
custom workspace and give the path of your project.

Go to build section and click on build step and select execute windows batch command.
One window will be opened there you give your batch file name. and click on apply and
save.
Now go back to project and click on build now.(make sure you have a created a batch file in
your project location).

When you click on build now it will execute the build based on the testng.xml.

Now click on the build which is executed and go to console output for the detailed report.
4. USERS
4.1. CREATING A USER
1. Login to jenkins as admin.
2. Click on Manage jenkins on the LHS

3. Scroll down to Manage Users and click on it

4. Click on create user


5. Enter all the required fields and click on Create user button.

User will be created and displayed in users list.

4.2. CONFIGURING USERS


1. Login as user.
2. On the top right corner username is displayed, click on the down arrow a list of
options are displayed.

3. Click on configure
4. Here we can change the full name, password, get the API token and add a
description.
4.3. CONFIGURING ROLES AND STRATEGIES

4.3.1. DOWNLOADING ROLE BASED AUTHORIZATION PLUGIN


1. Login to jenkins as admin
2. Click on manage jenkins
3. Scroll down to Manage Plugins,
4. Click on Available tab
5. Search for Role based Authorization plugin and click on Install
6. Once Installation is complete restart jenkins

4.3.2. MANAGING JENKINS-CONFIGURING GLOBAL SECURITY


1. Login to admin account
2. Go to manage jenkins
3. Click on Configure global security
4. Click on enable security
5. After installing Role based Authorization plugin it is displayed in Authorization section,
select it and click on save.

4.3.3. ASSIGNING ROLES


Go to manage Jenkins. Now we can see an option Manage and assign Roles. This is displayed
only after installation of Role based Authorization plugin.
Click on Manage Roles.
Initially only one role is displayed i.e. Admin
Here we have 3 sections:
1. Global Roles
2. Project Roles
3. Slave Roles
Global Roles provide access on a global level.
For example: An employee should have overall read access and overall view access.

To create a role Enter the name of the role in Role to add tab and click on add button

The role will be added to the global roles. We can give the overall read and view permissions.
Project Roles: We can create roles specific to the project.
For example Developer.

Dev.* means a person having a role of Developer should be able to access the projects starting
with Dev. He will not be able to access any other projects.

In the same way a Tester with pattern Test.*

Now we have to assign roles to users.


For example we have two users user1 and user2 .

To add assign roles to users go to manage jenkins->Manage and Assign Roles-> Assign Roles

In assign roles we have Global Roles, Item Roles and Node roles.
Now add User1 and User2 to global roles. Both of them are employees so we assign the role of
employee.

Coming to Item roles, add both user1 and User2 to Item roles.
User1 is developer so we assign role of developer.
User2 is tester so we assign role of tester.
And click on apply and then save.

Create two projects with the name Dev_Project and Test_Project.


Now login as User1 and check whether he can access only Dev_Project and login as User2 and
check whether he can access only Test_Project.
5. MANAGE JENKINS
5.1. CONFIGURING SYSTEMS

Вам также может понравиться