jenkins执行mysql脚本文件夹_如何在参数选项中从Jenkins groovy脚本执行shell脚本?...

我想在Uno-Choice动态参考参数中调用

shell脚本

并执行一些操作(创建一些文件并调用其他一些shell

来自被调用shell脚本的脚本).

截至目前,我能够调用shell脚本并捕获一些文件,但我无法做到

创建新文件或从中调用另一个shell脚本.

def sout = new StringBuffer(), serr = new StringBuffer()

// 1)

def proc ='cat /home/path/to/file'.execute()

//display contents of file

// 2)

def proc="sh /home/path/to/shell/script.sh".execute()

//to call a shell script but the above dosent work if I echo some contents

//into some file.

proc.consumeProcessOutput(sout, serr)

proc.waitForOrKill(1000)

return sout.tokenize()

例如: – 如果我添加行,则在script.sh中

echo "hello world" > test

然后没有创建测试文件

为了更多的理解:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值