I really confused by target /path/to/directory is not a directory
when i want to copying all files in build/*
to the direction in by this rule in gitlab-ci.yml
file:
script:
- cp -rf build/* /path/to/directory
I’ve also check this command by removing/adding /
at end and start of the destination but won’t help.
Note: it’s OK when i manually run the cp command in server terminal and have no problem with it.This command was successful when i run it manually through terminal in ubuntu server.
So what’s the problem here?
2
Answers
That is probably because the target folder exists in the server itself, while it might not exist in the context of the GitLab runner.
You should either:
create the target folder:
or mount the server target folder as a data volume:
I experienced a similar error because one of my files had a space in its name and so the path it was looking for was only reading the string after the space.