Let's create a job in Jenkins that provides details about IP addresses and other configuration details. Basically, we will execute the ipconfig
command. If you are using Linux OS, you can execute ifconfig
. The following are the steps to create your first job in Jenkins:
- On the Jenkins dashboard, click on
New Item
. - Enter the item's name.
- Select
Freestyle project
. - Click
Ok
:
- Give a
Project name
:
- Select
None
inSource Code Management
.
- In the
Build Triggers
section, selectBuild periodically
and give cron syntax inSchedule
. It will always run at 8:52 AM in the morning:
- In
Build
, click onExecute Windows batch command
. To execute on CentOS or other flavours of Linux, selectExecute Shell
, and the command will beifconfig
:
- In the textbox, write the
ipconfig
command to get the IP address of the system. - Click on
Save
:
- Click on
Build
now
:
- Observe the
Build History
and click on the blue ball to go toConsole Output
. Bingo! We have created our first job in Jenkins:
- To add a parameter in the Jenkins...