【问题标题】:How to pass argument to another jenkins build step如何将参数传递给另一个詹金斯构建步骤
【发布时间】:2013-09-18 18:54:18
【问题描述】:

在 Jenkins 工作中,我需要在 jenkins 机器上执行 shell。我使用Execute shell 步骤从那里获得价值,它必须在另一个步骤Execute shell script on remote host using ssh 中使用。我找不到传递该值的方法...

这是我的詹金斯工作配置:

感谢您的帮助。

【问题讨论】:

    标签: ssh jenkins continuous-integration


    【解决方案1】:

    包含脚本的文件内容:

    echo "VERSION=`/data/...`"> env.properties
    

    属性文件路径:

    env.properties
    

    在使用 ssh 的 shell 脚本中:

    echo"... $VERSION"
    

    这样的东西适用于构建,也许这里也适用。

    【讨论】:

    • 谢谢,它按预期工作。在注入环境变量中,我指出了 env.properties 文件,并且 shell 脚本访问了 $VERSION 属性。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2018-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 2020-06-09
    相关资源
    最近更新 更多