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:
- You can create pipelines automatically for all branches and can execute pull requests with just one JenkinsFile.
- You can later review your Jenkins pipeline.
- 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') {
...
}
}
}