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