1
我有一些代碼需要在不同的操作系統上運行(構建,測試和實際包,但例如只是運行tox
)。目前我Jenkinsfile
看起來像這樣:Jenkinsfile和多個節點
pipeline {
// Where to run stuff.
agent {
node {
label 'CentOS7'
customWorkspace '/home/build/jenkins/workspace/pipelines/ook'
}
}
// What to run goes here.
stages {
stage('Tox') {
steps {
sh 'tox -v --recreate'
}
}
}
// Clean up after ourselves.
post {
failure {
mail subject: "\u2639 ${env.JOB_NAME} (${env.BUILD_NUMBER}) has failed",
body: """Build ${env.BUILD_URL} is failing!
Somebody should do something about that\u2026""",
to: "[email protected]",
replyTo: "[email protected]",
from: '[email protected]'
}
}
}
}
的中間位,我想在兩個不同的nodes
運行:一個用於OS 1,一個用於OS 2.
我該怎麼辦呢?
任何想法如何在這種情況下定義'customWorkspace'? – Sardathrion
另外,我應該[更詳細地閱讀可怕的文檔](https://jenkins.io/doc/book/pipeline/jenkinsfile/#using-multiple-agents)...☹ – Sardathrion
[Tox旨在自動化和標準化測試在Python中。它是放寬Python軟件打包,測試和發佈流程的更大願景的一部分。](https://tox.readthedocs.io/en/latest/)。 – Sardathrion