DevOps Intermediate
Jenkins Pipeline¶
JenkinsPipelineCI/CD 3 min read
Jenkins Declarative Pipeline. Stages, agents, post actions.
Jenkinsfile¶
pipeline {
agent any
stages {
stage('Test') { steps { sh 'npm ci && npm test' } }
stage('Build') { steps { sh 'docker build -t myapp:${BUILD_NUMBER} .' } }
stage('Deploy') {
when { branch 'main' }
steps { sh 'kubectl set image deploy/app app=myapp:${BUILD_NUMBER}' }
}
}
post { failure { slackSend channel: '#ci', message: 'Build failed!' } }
}
Summary¶
Jenkins is flexible but requires maintenance. For new projects, consider GitHub Actions or GitLab CI.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.