如何将shell脚本添加到jenkins管道

如何将shell脚本添加到jenkins管道,shell,jenkins-pipeline,Shell,Jenkins Pipeline,我有以下shell脚本: du -sh /bbhome/shared/data/repositories/* |sort -h |tail -20 | while IFS= read -r line;do DIR=`echo $line | awk '{print$2}'` Rep=`cat $DIR/repository-config |grep 'project\|repo' | tr '\n' ' '` Size=`echo $line |

我有以下shell脚本:

du -sh /bbhome/shared/data/repositories/* |sort -h |tail -20 |
while IFS= read -r line;do
        DIR=`echo $line | awk '{print$2}'`
        Rep=`cat $DIR/repository-config |grep 'project\|repo' |  tr '\n' ' '`
        Size=`echo $line | awk '{print $1}' `
        echo $Size $Rep
done
我如何在Jenkins中运行它?我还需要向env添加ssh命令(不需要密码)。 注意,我不想连接到env并运行这个shell,而是直接从execue shell框运行


如果我没说错的话,你是在使用自由式作业,而不是管道作业。 无论如何,我认为你必须尝试以下方法:


ssh-tXXXXX@YYYYY如果我没记错的话,你是在用自由式作业,而不是管道作业。
无论如何,我认为你必须尝试以下方法:


ssh-tXXXXX@YYYYY我可能遗漏了一些东西,但是将脚本粘贴到框中的选项由于某种原因不起作用?不。我不知道如何将它与ssh命令结合使用:ssh-o strichostkeychecking=No-nXXXXX@YYYYYI可能遗漏了什么,但是,由于某种原因,将脚本粘贴到框中的选项不起作用?不。我不知道如何将它与ssh命令结合使用:ssh-o strichostkeychecking=No-nXXXXX@YYYYY