【发布时间】:2018-02-01 01:19:59
【问题描述】:
我正在使用 DSL 插件 API 从 groovy 脚本创建 jenkins 作业。我想在詹金斯工作中添加“执行 python 脚本”作为一个步骤。这是我在this 帖子之后所做的事情:
job('example') {
description('My first job')
displayName('Job DSL Example Project')
properties {
sidebarLinks {
// use uploaded image
link('https://wiki.acme.org/', 'Wiki', '/userContent/wiki.png')
}
}
steps {
python{
command(''' print("Hello")''')
nature('python')
}
}
}
在生成的作业中,添加的步骤是“Python Builder”步骤,如下图所示。 相反,我想要“执行 Python 脚本”步骤,如下所示。
注意:我已经安装了闪亮的熊猫插件。
【问题讨论】:
-
图片和屏幕截图可以很好地添加到帖子中,但请确保帖子在没有它们的情况下仍然清晰且有用。 Don't post images of code or error messages. 而是直接将实际代码/消息复制并粘贴到帖子中。
-
谢谢!我会记住这一点。你能帮我看看我哪里出错了。
标签: jenkins groovy jenkins-job-dsl