skip to Main Content

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


  1. it’s OK when i manually run the cp command in server terminal and have no problem with it.

    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:

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search