The extensible automation server for CI/CD, with pipelines defined as code in a Jenkinsfile. This walkthrough covers the mental model and the configuration you will actually touch.
Jenkins is a self-hosted automation server that runs build, test and deploy pipelines. Modern Jenkins defines those pipelines as code in a Jenkinsfile checked into the repo.
The configuration that matters
A declarative Jenkinsfile with stages and a post block.
pipeline {
agent any
options { timeout(time: 20, unit: 'MINUTES') }
stages {
stage('Build') { steps { sh 'make build' } }
stage('Test') { steps { sh 'make test' } }
stage('Deploy') {
when { branch 'main' }
steps { sh 'make deploy' }
}
}
post {
failure { echo 'Build failed - notifying team' }
always { junit 'reports/**/*.xml' }
}
}Principles to hold onto
- Use declarative pipelines and shared libraries to avoid copy-paste
- Run builds on ephemeral agents (Docker/Kubernetes) for clean, scalable CI
- Manage configuration as code with JCasC so the controller is reproducible
Everyday commands
# Trigger and follow a build via the CLI
java -jar jenkins-cli.jar -s http://localhost:8080 build myjob -f -vWant senior help putting Jenkins to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.