![](/img/trans.png)
[英]Jenkins scripted or declarative pipeline - how to set job description text
[英]How to run Jenkins scripted pipeline job on free slave?
我想在沒有其他作業在其上運行時在指定的從屬設備上運行 Jenkins 腳本化管道作業。 我的工作開始后,不應在此從屬上執行其他工作,他們將不得不等待我的工作結束運行
我發現的所有教程都允許我在節點上運行空閑時在該節點上運行作業,但並沒有保護我在該節點上啟動其他作業
你能告訴我我該怎么做嗎?
因為 Pipeline 有兩種語法,所以有兩種方法可以實現。 對於腳本管道,請檢查第二個。
pipeline {
agent none
stages {
stage('Build') {
agent { label 'slave-node' }
steps {
echo 'Building..'
sh '''
'''
}
}
}
post {
success {
echo 'This will run only if successful'
}
}
}
node('your-node') {
try {
stage 'Build'
node('build-run-on-this-node') {
sh ""
}
} catch(Exception e) {
throw e
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.