【问题标题】:Rundeck - The job that I created to run python scripts calls a different pythonRundeck - 我为运行 python 脚本而创建的作业调用了不同的 python
【发布时间】:2020-09-04 20:58:35
【问题描述】:
我对使用 Rundeck 还是很陌生。我的工作应该是执行一个 python 文件。只是为了给你一个概述,我的设备有 python 3.8.5 和 3.7。 Rundeck 使用 3.7 版,即使在我的环境变量中我将 PY_HOME 设置为 3.8.5 版。如何告诉我的 rundeck 使用 3.8.5 版?感谢您的帮助。
【问题讨论】:
标签:
python
windows
rundeck
【解决方案1】:
您可以在脚本步骤中为您的脚本(python2、python3 等)定义任何解释器,只需转到您的工作,在“脚本”步骤(内联脚本)或“脚本文件或 URL”步骤中单击“高级”按钮并在“调用字符串”文本框上添加 Python 3.8.5 的路径,在“扩展”文本框上添加“.py”,看看this。
我留下一个工作定义示例:
<joblist>
<job>
<defaultTab>nodes</defaultTab>
<description></description>
<executionEnabled>true</executionEnabled>
<id>031b03b4-220f-4ad0-9c47-3ca47506ba82</id>
<loglevel>INFO</loglevel>
<name>HelloWorldPy</name>
<nodeFilterEditable>false</nodeFilterEditable>
<plugins />
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<fileExtension>.py</fileExtension>
<script><![CDATA[print("hello world!")]]></script>
<scriptargs />
<scriptinterpreter>C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe</scriptinterpreter>
</command>
</sequence>
<uuid>031b03b4-220f-4ad0-9c47-3ca47506ba82</uuid>
</job>
</joblist>