簡體   English   中英

無法通過Jenkinsfile使用rake執行(查找)獲取命令

[英]Cannot execute (find) fetch command using rake via a Jenkinsfile

我已經閱讀了Rake中可以找到的大多數缺少的二進制文件,但是這種情況有所不同,因為它可以在我的開發環境中工作,但不能在Jenkins上工作。

我正在嘗試調用gruntworks( https://github.com/gruntwork-io/fetch )發布的獲取二進制文件

應該注意的是,Rakefile在開發機器上可以正常工作,但是當它通過JenkinsFile在Jenkins Pipeline上調用時,我無法使其正常工作。

我有一個帶有以下調用的Rakefile

sh "fetch --repo 'https://github.com/gruntwork-io/gruntkms' --tag 'v0.0.5' --release-asset='gruntkms_linux_amd64' _tools/"

問題中的二進制文件是存在正確的目錄結構(已編輯的完整內容)

$ ls -al . 
drwxrwxr-x  2 1000 1000   4096 Jan 29 10:37 _tools

$ ls -al _tools 
lrwxrwxrwx  1 1000 1000       17 Jan 29 10:37 fetch -> fetch_linux_amd64
-rwxr-xr-x  1 1000 1000   7651536 Jan 29 10:16 fetch_linux_amd64

路徑已正確設置為包含_tools目錄。

export PATH='/home/qa/jenkins/workspace/RQ/_tools:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

但是,我收到以下錯誤:

sh: fetch: not found
rake aborted!
Command failed with status (127): [fetch --repo 'https://github.com/gr...]

即使當我嘗試顯式調用二進制獲取時(這是一個ln),我仍然會收到未找到腳本的錯誤代碼(127)

_tools/fetch --repo 'https://github.com/gruntwork-io/gruntkms' --tag 'v0.0.5' --release-asset='gruntkms_linux_amd64' _tools/
sh: _tools/fetch: not found
rake aborted!
Command failed with status (127): [_tools/fetch --repo 'https://github.com/gr...]

我還確認了最新版本的提取二進制文件(0.3.2)仍然存在該問題。 我不認為這是問題所在,但是為了確定起見,我嘗試了一下。

在撰寫本文時更新到最新版本的https://github.com/gruntwork-io/fetch(0.3.2 )確實可以解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM