Creating a Pipeline in Jenkins
About 113 wordsLess than 1 minute
2025-12-22
Jenkins pipelines automate the build, test, and deployment process. They can be defined using Groovy-based DSL.
Declarative Pipeline Example
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building the application...'
}
}
stage('Test') {
steps {
echo 'Running tests...'
}
}
stage('Deploy') {
steps {
echo 'Deploying to production...'
}
}
}
}Steps to Create a Pipeline
- Log in to Jenkins and click "New Item".
- Enter a name and select "Pipeline" as the type.
- In the configuration, scroll to "Pipeline" section.
- Choose "Pipeline script" and paste your Groovy code.
- Save and run the pipeline.