gpt4 book ai didi

jenkins - 如何从Jenkins的Windows机器在远程linux机器中启动脚本?

转载 作者:行者123 更新时间:2023-12-02 14:34:50 25 4
gpt4 key购买 nike

我需要使用Jenkins在Windows机器上的远程Linux机器中启动脚本。最好的方法是什么?我听说并在ssh上阅读了一些。但这不会涉及使用像腻子这样的客户吗?我怎么能从 Jenkins 做到这一点?

最佳答案

您必须在 Jenkins (Jenkins)寻找XShell plugin

这是插件帮助部分的摘录-

Runs a shell script (defaults to sh, but this is configurable) for building the project. The script will be run with the workspace as the current directory. Type in the contents of your shell script. If your shell script has no header line like #!/bin/sh —, then the shell configured system-wide will be used, but you can also use the header line to write script in another language (like #!/bin/perl) or control the options that shell uses. By default, the shell will be invoked with the "-ex" option. So all of the commands are printed before being executed, and the build is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/... line to change this behavior.

As a best practice, try not to put a long shell script in here. Instead, consider adding the shell script in SCM and simply call that shell script from Jenkins (via bash -ex myscript.sh or something like that), so that you can track changes in your shell script.

关于jenkins - 如何从Jenkins的Windows机器在远程linux机器中启动脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33263252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com