【问题标题】:Gitlab CI - not supported: outside build directoryGitlab CI - 不支持:外部构建目录
【发布时间】:2021-12-03 12:54:31
【问题描述】:

我在保存工件时遇到问题。项目分为3个模块,其中一个保存,另外两个不保存。

克隆项目: 克隆到 '/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis/../project-root 克隆到 '/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis/../project-core

artifacts:
paths:
  - /home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis
  - /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root
expire_in: 10 min

LOGS 管道:

  Uploading artifacts...
  Runtime platform                                    arch=amd64 os=linux pid=24943 
  revision=54944146 version=13.10.0
  /home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis: found 2240 
  matching files and directories 
  
  WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root: not 
  supported: outside build directory 
  WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/pom.xml: 
  not supported: outside build directory 
  WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/src: not 
  supported: outside build directory 
  WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/src/main: 
  not supported: outside build directory 
  WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project- 
  root/src/main/resources: not supported: outside build directory 
   WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project- 
   root/src/main/resources/application.properties: not supported: outside build 
   directory 

问题出在哪里?

【问题讨论】:

  • 能否分享更多.gitlab-ci.yaml的代码?

标签: gitlab continuous-integration cicd


【解决方案1】:

GitLab 只能打包在$CI_PROJECT_DIR 目录中找到的artifacts(在您的示例中为/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis)。

您应该始终克隆 git 存储库并在以 ./ 作为根目录的文件夹中构建软件,而不是使用绝对路径:

job:
  # do git clones and builds in . ($CI_PROJECT_DIR)
  # ...
  artifacts:
    paths:
      - project-root
    expire_in: 10 min

【讨论】:

    猜你喜欢
    • 2018-08-30
    • 2020-05-26
    • 2015-10-07
    • 2016-01-30
    • 1970-01-01
    • 2019-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多