Jenkins pipeline is the script file, typically written using Groovy language, where you can mention all the tasks that you want your Jenkins to run for your job. This replaces the manual way of configuring your job from Jenkins UI.
For example, when you create a simple free style job from Jenkins UI, you mention GIT repository, and probably add one task of compiling and packaging the program. As a result of this, when you run a build Jenkins will checkout the source code from the repository, and compile and package it to give you a war/jar file, depending upon your program. Now, if any further change needs to be done, say adding a Unit testing step, you would typically go to Jenkins UI and add a build step with Unit testing. This manual way of editing UI is at times not scalable in enterprise environment when you have 10s and 100s of jobs.
Jenkins pipeline provides an easier way to manage your build configuration. Instead of configuring your steps on Jenkins UI, you create a text file named 'Jenkinsfile', and add your steps like source code checkout, compile, package, test etc... in the file. And now once you run the build, Jenkins will read this file and execute the Job. Any further change can easily be done in the Jenkinsfile.
Below are the steps to configure Jenkins Pipeline
node (‘label’){
For example, when you create a simple free style job from Jenkins UI, you mention GIT repository, and probably add one task of compiling and packaging the program. As a result of this, when you run a build Jenkins will checkout the source code from the repository, and compile and package it to give you a war/jar file, depending upon your program. Now, if any further change needs to be done, say adding a Unit testing step, you would typically go to Jenkins UI and add a build step with Unit testing. This manual way of editing UI is at times not scalable in enterprise environment when you have 10s and 100s of jobs.
Jenkins pipeline provides an easier way to manage your build configuration. Instead of configuring your steps on Jenkins UI, you create a text file named 'Jenkinsfile', and add your steps like source code checkout, compile, package, test etc... in the file. And now once you run the build, Jenkins will read this file and execute the Job. Any further change can easily be done in the Jenkinsfile.
Below are the steps to configure Jenkins Pipeline
- In your root of your project, create a file called 'Jenkinsfile'
- Open it and add few steps, as follows
node (‘label’){
No comments:
Post a Comment