找不到Gitlab ci文物

时间:2017-11-25 21:28:43

标签: gitlab-ci-runner

。您好,有人能告诉我,为什么gitlab无法找到我的文物?

日志文件:

$ ls -la /build/Project*.zip
-rw-r--r-- 1 root root 1641 Nov 25 21:18 /build/Project-1.0.zip
Uploading artifacts...
WARNING: /build/Project*.zip: no matching files

CI文件:

package:
  stage: package
  script:
    - ... ... ...
    - ls -la /build/Project*.zip
  only:
    - master
  artifacts:
    paths:
      - "/build/$CI_PROJECT_NAME*.mkp"
    expire_in: 1 week

2 个答案:

答案 0 :(得分:14)

工件的路径必须相对于$ CI_PROJECT_DIR并且是其子代。

答案 1 :(得分:0)

使其相对于 $CI_PROJECT_DIR。

就这样:

    - cp -r $(pwd)/target/*.html $CI_PROJECT_DIR/report
    - ls -la $CI_PROJECT_DIR/report
  artifacts:
    paths:
    - report/*.html

要了解更多信息,请访问:https://gitlab.com/gitlab-org/gitlab-foss/-/issues/15530