简体   繁体   English

Jenkins管道-找不到文件

[英]Jenkins pipeline - file not found

I have a simple pipeline job to: 1) checkout a git branch 2) cd to a run directory 3) execute an existing script to run tests 我有一个简单的管道作业:1)检出git分支2)cd到运行目录3)执行现有脚本以运行测试

The pipeline script itself is very simple at this point: 此时,管道脚本本身非常简单:

stage 'build'
node {
    git url: 'git@hd1:nip_5g_fpga', branch: "Phase_UL_1a"
    sh "pwd"
    sh "echo $PATH"
    sh "ls"
    dir ('nip_fpga/verification/src/UE/env/top_level/run') {
        sh "source vcs_bash.sh 1" 
    }
}

When I run this, I get the following error (showing only a part of the console): 运行此命令时,出现以下错误(仅显示控制台的一部分):

Running
in /var/lib/jenkins/workspace/nip_regression_nightly/nip_fpga/verification/src/UE/env/top_level/run
[Pipeline] {
[Pipeline] sh
[run] Running shell script
+ source vcs_bash.sh 1
/var/lib/jenkins/workspace/nip_regression_nightly/nip_fpga/verification/src/UE/env/top_level/run@tmp/durable-c40e151e/script.sh: line 2: source: vcs_bash.sh: file not found

I have checked that vcs_bash.sh itself exists but it exists in .../top_level/run directory and not in top_level/run@tmp directory. 我检查了vcs_bash.sh本身是否存在,但它存在于.../top_level/run目录中,而不存在于top_level/run@tmp目录中。 So, I am confused how to get around this. 所以,我很困惑如何解决这个问题。

Also, I don't understand the concept of tmp directory that pipeline is creating 另外,我不理解管道正在创建的tmp目录的概念

知道管道jenkins插件将来自git的代码存储在folder @ script文件夹中,我已经使用了这个小技巧来访问我的sh文件:

sh "../workspace@script/myScriptName.sh"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM