Evg*_*urg 8 jenkins jenkins-plugins jenkins-pipeline
我想使用提到的插件与声明性管道,准确地说,我想将以下文档示例转换为声明性管道:
上游作业中的管道代码如下:
stage ('Stage 1. Allocate workspace in the upstream job')
def extWorkspace = exwsAllocate 'diskpool1'
node ('linux') {
exws (extWorkspace) {
stage('Stage 2. Build in the upstream job')
git url: 'https://github.com/alexsomai/dummy-hello-world.git'
def mvnHome = tool 'M3'
sh '${mvnHome}/bin/mvn clean install -DskipTests'
}
}
Run Code Online (Sandbox Code Playgroud)
下游的Pipeline代码是:
stage ('Stage 3. Select the upstream run')
def run = selectRun 'upstream'
stage ('Stage 4. Allocate workspace in the downstream job')
def extWorkspace = exwsAllocate selectedRun: run
node ('test') {
exws (extWorkspace) {
stage('Stage 5. Run tests in the downstream job')
def mvnHome = tool 'M3'
sh '${mvnHome}/bin/mvn test'
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
小智 0
您可以使用此代理指令:
agent {
node {
label 'my-defined-label'
customWorkspace '/some/other/path'
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
714 次 |
| 最近记录: |