Jenkins freestyle jobs served us well for years. But with 50 projects and increasingly complex builds, they became unmaintainable. Jenkins Pipeline brought build pipelines defined as code in a Jenkinsfile — versioned, reviewed, reproducible.
Pipeline as Code¶
pipeline {
agent any
stages {
stage('Build') {
steps { sh 'mvn clean compile' }
}
stage('Test') {
steps { sh 'mvn test' }
post { always { junit 'target/surefire-reports/*.xml' } }
}
stage('Package') {
steps {
sh 'mvn package -DskipTests'
archiveArtifacts 'target/*.war'
}
}
stage('Deploy to Staging') {
when { branch 'develop' }
steps { sh './deploy.sh staging' }
}
}
}
Shared Libraries and Multibranch¶
A shared library core-pipeline-lib with functions like deployToEnvironment() and runSonarAnalysis(). Multibranch Pipeline automatically detects branches — a feature branch gets an automatic build.
Jenkinsfile Belongs in Every Repository¶
The build process is part of the project — versioned and reviewed. If you’re still using freestyle jobs, migrate to Pipeline.
Need help with implementation?
Our experts can help with design, implementation, and operations. From architecture to production.
Contact us