1
我試圖使用這個有條件的多步驟插件,併爲DSL編寫了grrovy腳本,但是當我使用這段代碼引導時,列出的步驟在條件塊之前是外部的,我在這裏做錯了什麼?Jenkins conditionalstep groovy腳本
代碼:
其被創建如圖npm install
mkdir buildArchive
Conditional step
而不是
Conditional step
{
npm install
mkdir buildArchive
}
我在做什麼錯
def configSeed(environment, slaveLabel) {
{ it ->
parameters {
stringParam('BUILD_REQUIRED', 'true', '');
}
scm {
git {
remote {
name('origin');
url('xyz');
refspec('$GERRIT_REFSPEC');
credentials('xyz');
}
branch('$GERRIT_BRANCH');
strategy {
gerritTrigger();
}
}
}
steps {
conditionalSteps {
condition {
stringsMatch('${BUILD_REQUIRED}', 'true', false)
}
runner('Fail')
steps {
environmentVariables {
envs(environment);
}
batchFile('''
call npm install
''');
batchFile('''
call mkdir buildArchive
''');
}
}
}
publishers {
wsCleanup {
includePattern('build/**')
}
}
wrappers {
preBuildCleanup();
timeout {
noActivity(300);
abortBuild();
}
}
label(slaveLabel);
}
};
所以詹金斯工作 這裏?
什麼_「...列出的步驟是在條件塊之前...」是_是什麼意思? –
@tim_yates更新了上述說明。我在上面的條件步驟之外看到命令,而不是在它之內。 – NxC