亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

找不到在 gitlab runner 中下載的文件

找不到在 gitlab runner 中下載的文件

幕布斯6054654 2022-07-27 21:28:00
我正在為一個 gradle 項目設置 GitLab CI。下載 gradle 后,unzip 命令報告即使下載成功,也沒有找到 zip 文件。我添加了一個 ls 只是為了查看目錄的內容,而我的 zip 文件不存在。下面是我的 .gitlab-ci.yml 文件image: docker:lateststages:  - build before_script:  - cd /usr/lib  - curl https://services.gradle.org/distributions/gradle-2.10-bin.zip -o gradle-2.10-bin.zip  - unzip "gradle-2.10-bin.zip"  - ln -s "/usr/gradle-2.10/bin/gradle" /usr/bin/gradle  - rm "gradle-2.10-bin.zip"  - export GRADLE_HOME=usr/lib/gradle-2.10  - export PATH=$PATH:$GRADLE_HOME/binbuild_job:  image: java:8  stage: build  script:    - gradle -v這是作業的錯誤輸出$ unzip "gradle-2.10-bin.zip" unzip: 找不到或打開 gradle-2.10-bin.zip、gradle-2.10-bin.zip.zip 或 gradle-2.10-bin.zip.ZIP。錯誤:作業失?。和顺龃a 1
查看完整描述

1 回答

?
ABOUTYOU

TA貢獻1812條經驗 獲得超5個贊

這不是該命令的完整錯誤輸出,這是:


$ unzip "gradle-2.10-bin.zip"

Archive:  gradle-2.10-bin.zip

  End-of-central-directory signature not found.  Either this file is not

  a zipfile, or it constitutes one disk of a multi-part archive.  In the

  latter case the central directory and zipfile comment will be found on

  the last disk(s) of this archive.

unzip:  cannot find zipfile directory in one of gradle-2.10-bin.zip or

        gradle-2.10-bin.zip.zip, and cannot find gradle-2.10-bin.zip.ZIP, period.

如果我們檢查它,該文件是空的。如果我們curl -I在該 url 上執行操作,我們會得到 301,因此您需要添加-L到該 curl 命令以遵循重定向:


curl -L https://services.gradle.org/distributions/gradle-2.10-bin.zip


查看完整回答
反對 回復 2022-07-27
  • 1 回答
  • 0 關注
  • 214 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號