In the last article, we have seen how to write the pipeline script.
In this article, we going to learn how to use the Pipeline script from SCM.
Prerequisite
- Jenkinsfile must be located in the SCM(Github,Bitbucket,…)
Create Pipeline Project
In the Jenkins Dashboard, click on New Item to create new Pipeline Project.
Scroll down to the Pipeline section. In the dropdown select the Pipeline script from SCM option.
Provide the SCM - Git
Get the Repository URL.
Credentials are not required since it is a Public repo.
Provide the Branch details.
Provide the Script path(Jenkinsfile path)
In my repo I have my Jenkinsfile in the root dir. So, the file name is good to go. If you have palced the file in some other folders please provide the exact path to the Jenkinsfile.
Click Save.
Build Now
Now build this project.
You can check the logs for each stage in the Pipeline.
In this article, we have learned how to use Pipeline script from SCM.
Happie Learning :)
Keep Learning!!!
Top comments (0)