DEV Community

Logesh Sakthivel
Logesh Sakthivel

Posted on

Jenkins Pipeline script from SCM

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.

Pipeline Project

Scroll down to the Pipeline section. In the dropdown select the Pipeline script from SCM option.

Pipeline script from SCM

Provide the SCM - Git

Git

Get the Repository URL.

Repo URL

Credentials are not required since it is a Public repo.

Add URL

Provide the Branch details.

Branch details

Provide the Script path(Jenkinsfile path)

Jenkins file

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.

Build out

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)