Ở bài này chúng ta cùng tìm hiểu cách 2 job build trong jenkins trigger nhau như thế nào?
Mình sẽ có 2 Job là hellowork và pipeline-stage-steps-script
Scipt của job hello-world
pipeline{
agent{
node{
label "k8s-permanent"
customWorkspace "/home/nimtechnology"
}
}
stages{
stage("Build"){
steps{
echo "Hello world"
}
}
}
}
Sau đó mình ấn build
thì với script của job pipeline-stage-steps-script
pipeline{
agent{
label 'jenkins-k8s-agent'
}
triggers{
upstream(upstreamProjects: 'hello-world',
threshold: hudson.model.Result.SUCCESS)
}
stages{
stage('Build'){
steps{
echo "Trigger project hello-world"
}
}
}
}
Khi mà job hello-world build thành công thì Job stage-steps-script sẽ thực hiện build
