[英]Jenkins pipeline - file not found
我有一個簡單的管道作業:1)檢出git分支2)cd到運行目錄3)執行現有腳本以運行測試
此時,管道腳本本身非常簡單:
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"
}
}
運行此命令時,出現以下錯誤(僅顯示控制台的一部分):
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
我檢查了vcs_bash.sh本身是否存在,但它存在於.../top_level/run
目錄中,而不存在於top_level/run@tmp
目錄中。 所以,我很困惑如何解決這個問題。
另外,我不理解管道正在創建的tmp目錄的概念
知道管道jenkins插件將來自git的代碼存儲在folder @ script文件夾中,我已經使用了這個小技巧來訪問我的sh文件:
sh "../workspace@script/myScriptName.sh"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.