Rundeck-我创建的用于运行python脚本的作业调用了另一个python

时间:2020-09-04 04:07:34

标签: python windows rundeck

我在使用Rundeck方面还很陌生。我有应该执行python文件的工作。为了给您一个概述,我的设备安装了python 3.8.5和3.7。即使在环境变量中我将PY_HOME设置为3.8.5版,Rundeck仍使用3.7版。如何告诉我的阳台使用3.8.5版?感谢帮助。

1 个答案:

答案 0 :(得分:0)

您可以在脚本步骤中为脚本(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>