CICD Tutorial: Create a Pipeline using JenkinsFile

Devansh Markan
Nov 19, 2020

Hello! Welcome back to this CICD Tutorial series. This time we are going with the creation of pipeline using JenkinsFile. This is quite an easy tutorial if you are following my previous tutorial series on Jenkins.

Most of the steps in this tutorial are similar to my previous tutorial — Jenkins Integration with SonarQube Tutorial. Click on this link to refer from that. I will tell you till when the steps are quite the same.

The steps in this tutorial are the same as the link above till where we Give the repository location in the specified placeholder and Provide the complete path of the pom.xml file.

Now, after that- The link of the Github Repository that we have to give has to contain a file named “Jenkinsfile” that tells the Jenkins server what tasks to do.

Just like in this example:- we have “mvn clean”, “mvn install” as the commands in this JenkinsFile.

Another important step: In the goals specify “clean, test and install” as the maven goals. Otherwise, it will not be successful.

Now, since the configuration part is over, click Apply and after that, you will be directed to a dashboard. Click on BUILD NOW option to build the project.

If you will check the “Console Output” option, the build will be successful. So, this is the end of this tutorial. We have build the Pipeline using JenkinsFile.

Thank You!!

--

--

Devansh Markan

Tech-enthusiast and looking for learning new technologies and writing technical blogs here.