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!' } }
}
Shrnuti¶
Jenkins je flexibilni ale vyzaduje udrzbu. Pro nove projekty zvazte GitHub Actions nebo GitLab CI.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.