【问题标题】:Jenkins running Linux shell program does not reccogize commandsJenkins 运行 Linux shell 程序不识别命令
【发布时间】:2016-08-26 17:44:48
【问题描述】:

我在 jenkins 构建步骤上运行了以下代码:“执行 shell”

#!/bin/sh
workspaceDirectory=WORKSPACE
appName=ClaimCenter

perl WORKSPACE/directory/scripts/FileLoaderDoItTwiceFinal.pl  $workspaceDirectory $appName
curl --ntlm --user myUserName:myPassword --upload-file WORKSPACE/directory/test/ClaimCenterUnmatchedProperties.csv     https://sharpoint/share/sharesight/TrainingManuals/RTC/PropertyFileAnalyzer/filename.csv`

appName=ContactManager

perl WORKSPACE/dircectory/scripts/FileLoaderDoItTwiceFinal.pl $workspaceDirectory $appName
curl --ntlm --user myUserName:MyPassWord --upload-file WORKSPACE/CliamCenterBatch/test/ContactManagerUnmatchedProperties.csv
https://sharpoint/share/sharesight/TrainingManuals/RTC/PropertyFileAnalyzer/filename.csv`

Jenkins构建时间长,重复测试非常困难,但是构建操作发生后,jenkins控制台输出如下:

 [TEST-SAMPLE-BUILD-CLAIMS_Dev_Tools_blucas-DEF] $ /bin/sh/tmp/hudson4025671051509183982.sh
/tmp/hudson4025671051509183982.sh: line 5: perl: command not found
/tmp/hudson4025671051509183982.sh: line 6: curl: command not found
/tmp/hudson4025671051509183982.sh: line 10: perl: command not found
/tmp/hudson4025671051509183982.sh: line 11: curl: command not found
/tmp/hudson4025671051509183982.sh: line 12: https://sharpoint/share/sharesight/TrainingManuals/RTC/PropertyFileAnalyzer/filename.csv` : No such file or directory

请帮助我理解为什么这个构建不理解这些命令

【问题讨论】:

    标签: linux perl shell curl jenkins


    【解决方案1】:

    错误消息告诉您找不到perlcurl 二进制文件,这意味着您的脚本环境没有设置PATH 环境变量。

    要解决此问题,请使用二进制文件的完整路径,而不仅仅是它们的名称。例如:

    /usr/bin/perl WORKSPACE/directory/scripts/FileLoaderDoItTwiceFinal.pl $workspaceDirectory $appName
    
    /usr/bin/curl --ntlm --user myUserName:myPassword --upload-file WORKSPACE/directory/test/ClaimCenterUnmatchedProperties.csv     https://sharpoint/share/sharesight/TrainingManuals/RTC/PropertyFileAnalyzer/filename.csv`
    

    【讨论】:

    • 现在它只是说没有这样的文件或目录而不是没有命令
    猜你喜欢
    • 1970-01-01
    • 2015-08-03
    • 2017-09-07
    • 1970-01-01
    • 1970-01-01
    • 2021-05-11
    • 1970-01-01
    • 1970-01-01
    • 2011-04-11
    相关资源
    最近更新 更多