繁体   English   中英

GitLab CI-Build Artifacts命令行下载

[英]GitLab CI-Build Artifacts command line download

GitLab版本-11.8.1,并尝试在Ubuntu -14.04-LTS系统的终端上下载CI-Build工件zip文件。

使用以下命令

curl -XGET --header "PRIVATE-TOKEN:avxa_afdfouqernadfg" -o artifacts.zip https://gitlab.com/api/v4/projects/78/builds/artifacts/master/download?job=ci-build

命令成功完成,但是在解压缩artifacts.zip文件时出现以下错误。

Archive:  artifacts.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 artifacts.zip or
        artifacts.zip.zip, and cannot find artifacts.zip.ZIP, period.

您的网址有误。 应该是工作而不是建筑

curl -X GET --header "PRIVATE-TOKEN:avxa_afdfouqernadfg" -o artifacts.zip "https://gitlab.com/api/v4/projects/78/jobs/artifacts/master/download?job=ci-build"

我还建议在您的curl调用中添加-v ,这样您将看到一个错误: HTTP/1.1 404 Not Found

请参阅: https//docs.gitlab.com/ee/api/jobs.html#download-the-artifacts-archive

暂无
暂无

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

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