Gitlab CI - not supported: outside build directory
Asked Answered
C

1

6

I have a problem with saving the artifact. The project is divided into 3 modules, one of them is saved and the other two are not.

Clonning project: Cloning into '/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis/../project-root Cloning into '/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 pipeline:

  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 

Where is the problem?

Cowper answered 15/10, 2021 at 9:34 Comment(1)
Can you please share more code of your .gitlab-ci.yaml?Imidazole
I
9

GitLab is only able to package artifacts found in the $CI_PROJECT_DIR directory (/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis in your example).

You should always clone git repositories and build software in folders with ./ as root directory and not use absolute paths:

job:
  # do git clones and builds in . ($CI_PROJECT_DIR)
  # ...
  artifacts:
    paths:
      - project-root
    expire_in: 10 min
Imidazole answered 15/10, 2021 at 21:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.