简体   繁体   English

Gitlab CI 保存神器

[英]Gitlab CI saving artifacts

What I am expecting:我所期待的:

I am trying to generate documentation in my CI script.我正在尝试在我的 CI 脚本中生成文档。 I want that documentation to be stored in my repository.我希望将该文档存储在我的存储库中。

I could be understanding the use of artifacts wrong but should this not do the trick?我可能会错误地理解工件的使用,但这不应该解决问题吗?

building_documentation:
  stage: buildDoc
  only:
    - develop
  script:
    - npm run arkit
    - npm run doc
  artifacts:
    paths:
      - $CI_PROJECT_DIR/docs

The stage runs and completes without any errors.该阶段运行并完成,没有任何错误。 This is the output from the console (docker):这是来自控制台(docker)的 output: 在此处输入图像描述

But after it runs, when I look in my repository there is still no docs folder there containing the documentation generated by npm run doc .但是在它运行之后,当我查看我的存储库时,仍然没有包含由npm run doc生成的文档的 docs 文件夹。

In case the information is needed:如果需要信息:

  • All CI steps pass.所有 CI 步骤均通过。

Artifact feature upload job artifacts created by Gitlab runner to the Gitlab server.工件功能将 Gitlab 运行程序创建的作业工件上传到 Gitlab 服务器。 Then, you can are download them as a single archive using the GitLab UI or the GitLab API.然后,您可以使用 GitLab UI 或 GitLab API 将它们作为单个存档下载。

Artifacts are not pushing back to your repository using artifacts .工件不会使用artifacts推回您的存储库。 If you want to do this, you need to git add/commit and push back in your repository adding git commands in your .gitlab-ci.yml如果你想这样做,你需要 git 添加/提交并在你的存储库中推回在你的.gitlab-ci.yml添加git命令

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

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