You can learn about setting up the build job in Jenkins.
About this task
To set up a build jobs in Jenkins, you must create and configure the following jobs
in Jenkins to automate the various stages for the pipeline:
- Build_Input: Job for building the application.
Procedure
Perform the following steps to create the Build_Input job:
-
Sign in to your Jenkins application with valid login credentials.
-
Click New Item.
-
Type Build_Input in the Enter an item
name field.
-
Select Freestyle project.
-
Click Ok.
The Build_Input job is created and configuration page is displayed.
-
In the General section, select This project is
parametrised check box.
-
Click Add parameter, and then select String
Parameter from the list.
-
Type the name for the String Parameter. For example,
build number.
-
Optional: Type the default value for the parameter in the Default
Value field.
-
Optional: Type the description for the parameter in the Description
field.
-
In the Source Code Management section, select
Git.
-
Type the URL of the GitHub repository in the Repository URL
field. For example, https://github.com/username/reponame.
-
In the Credentials section, click the drop down list, and
then select credentials.
If you are selecting the credentials for the first time, then you must add the
credentials to Jenkins, and then select them from the
Credentials section.
-
In the Branch Specifier field, add the GitHub branch name.
For example */main.
-
In the Build Steps section, click Add build
step, and then select Execute shell from the
list.
-
Type the following command in the Command field:
-
Click Save.
You have created a Build_Input job in Jenkins.
What to do next
You can learn about adding a Jenkins application in the
pipeline and configuring the build jobs to the different environments in the pipeline. See
Lesson 8: Adding a Jenkins application in the pipeline.