我有一个在远程服务器上执行 shell 脚本的 Jenkins 作业。现在我想连同 shell 脚本一起发送一些参数。下面的示例可能会让您了解更多。
variable1={git-URL}
variable2={branch}
我希望将此参数传递给远程机器上的 shell 脚本,并且应该像下面这样执行
#/usr/local/bin/check_out_code.sh <git-url> <branch>
如果有人能指出我一些解决方法,那就太好了
谢谢。
最佳答案
您可以像 linux 中的任何其他变量一样引用任何环境变量,包括 Jenkins 参数:${VARNAME}
关于linux - Jenkins 在远程机器上执行带有参数的 shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30052730/