You are on page 1of 3

Experiment No.

10th
Student Name: Pratap Mukherjee UID: 22MCC20021

Branch: MCA - CCD Section/Group: 22MCD-1/ Grp A


Semester: IV Date of Performance: 19th April 24
Subject Name: CI/CD Lab Subject Code: 22CAH-781

1. Aim/Overview of the practical:


Build maven project using build node whenever there is a push on Master Node.

2. Steps & Output for experiment:


Setup up the agent1 on jenkins.

a) Go to your Jenkins dashboard


b) Go to Manage Jenkins option in main menu
c) Go to Manage Nodes and clouds item
d) Go to New Node option in side menu
e) Fill the Node/agent name and select the type; (e.g. Name: agent1, Type: Permanent Agent). Now fill
the fields.
f) Press the Save button and the agent1 will be registered, but offline for the time being. Click on it.

g) Now, Go to your jenkins dashboard.


h) Select New Item on side menu;
i) Enter a name. (e.g.: First Job to Agent1)
j) Select the Pipeline project and press OK;
k) Check the option: Restrict where this project can be run;
l) Fill the field: label with the agent1 label; (e.g.: agent1)
m) Click ‘Save’ and start by clicking on Build Now.

After the above steps,

 Continue to configure SCM (source code management) to plan a build on every push operation by
master node in Jenkins.
 Now, choose “Pipeline Script from SCM” from the Definition drop down list.
 Choose Git in SCM option and provide the repository URL in the blank space provided. Move
ahead and verify the branch name i.e., main or master.
 Now, enter a “Script Path” name say, jenkinsfile, in the blank space. Be careful with the character
case.
 Then, create a text file with the same name (i.e., jenkinsfile) and write the pipeline script here. Now,
push it to the repository whose URL you have provided in step ii.
 Now, click on Save.
 Finally, we can see our maven project is triggered on the agent node with the specific SCM
configuration on every push by Master Node.

3. Learning outcomes (What I have learned):


a. Learned to build maven project using build node whenever there is a push on
Master Node.

You might also like