Jenkins · Declarative pipeline basics
A minimal Jenkinsfile
Put a Jenkinsfile in the root of your repository.
pipeline {
agent any
stages {
stage('Build') {
steps { sh 'make build' }
}
stage('Test') {
steps { sh 'make test' }
}
}
}
Official Jenkins documentation
More declarative pipeline basics commands
- Run in a Docker container
- Set environment variables
- Set pipeline options
- Ask for parameters
- Run on a schedule
- Run a stage conditionally
All declarative pipeline basics commands · Jenkins cheatsheet