I have a GitLab project and my .gitlab-ci.yml
looks like this:
stages:
- build
- deploy
image: registry.gitlab.com/myuser/myproj/ubuntuxenial:v1
before_script:
- cd /home
- mkdir docker
- cd docker
- git clone "https://xxx@github.com/myuser/myproj.git" repo
- cd repo
render_site:
stage: build
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME--$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
expire_in: 1 week
paths:
- home/docker/repo/
script:
- Rscript build.R
...
I have provided the essential parts of the file in the context of this issue. As you can see, this automation is intended to do the following:
- Clone a repository.
- Invoke a build command inside the repository (I am using R). This step will generate some output files in the repository folder.
- Make sure to publish artifacts, I want to publish the content of the whole repository
repo
folder.
Note I have set GitLab to use Docker images. I am using a Unix image I have uploaded in my registry.
Problem
The issue happens in the first job: render_site
. Everything goes fine, the commands are executed and all builds fine. However, the last line in the log for that task is:
Uploading artifacts...
WARNING: home/docker/repo/: no matching files
ERROR: No files to upload
Troubleshooting
I understand the issue is in the path I provide in .gitlab-ci.yml
. I have tried the following:
home/docker/repo/
/home/docker/repo/
repo/
Nothing works. This path that we specify, what is it relative to??? The documentation mentions:
You can only use paths that are within the project workspace.
What does it mean? I am creating a container every time I push and I cd
into different directories in the commands I specify in .gitlab-ci.yml
, so what is the project workspace the documentation mentions?