What Is JenkinsFile?

Jenkins Pipeline can be defined by a text file called JenkinsFile. You can implement a pipeline as code using JenkinsFile.

The advantages of using JenkinsFile are:

  1. You can create pipelines automatically for all branches and can execute pull requests with just one JenkinsFile.
  2. You can later review your Jenkins pipeline.
  3. You can later review your code on the pipeline.

Jenkinsfile syntax:-

pipeline {  
    agent any  
    stages { 

            stage ('Commit') {
                ...
            } 
            stage ('Build') {  
                ...  
            }  
            stage ('Test') {  
                ...  
            }  
            stage ('QA') {  
                ...  
            }  
            stage ('Deploy') {  
                ...  
            }  
            stage ('Monitor') {  
                ...  
            }  
    }  
}
Subscribe Now