Prompt
Jenkins build test deploy pipeline
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
Here’s a simple Jenkins build-test-deploy pipeline example using a Jenkinsfile.
Example Jenkinsfile
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
echo 'Building the application...'
sh 'mvn clean package'
}
}
stage('Test') {
steps {
echo 'Running tests...'
sh 'mvn test'
}
}
stage('Deploy') {
steps {
echo 'Deploying application...'
sh './deploy.sh'
}
}
}
post {
success {
echo 'Pipeline completed successfully!'
}
failure {
echo 'Pipeline failed.'
}
}
}
What each stage does
- Checkout: Pulls the source code from the repository.
- Build: Compiles the application and creates artifacts.
- Test: Runs automated tests.
- Deploy: Deploys the application to your target environment.
Notes
- If you're using Gradle, replace Maven commands with:
sh './gradlew build' sh './gradlew test' - For a Node.js app:
sh 'npm install' sh 'npm test' sh 'npm run build'
If you want, I can also provide:
- a real-world Jenkinsfile with Docker
- a multi-branch pipeline setup
- a pipeline with approval before deploy