-1

I'm currently using the Gitlab Pipelines to upload everything to my server.

The .gitlab-ci.yml path for uploading to the staging folder looks like the following:

staging_upload:
  stage: staging
  only:
    refs:
      - develop
      - schedules
  script:
    - sshpass -V
    - sshpass -p '$FTP_PASSWORD' rsync --progress -avz -e ssh . $FTP_USERNAME@$HOST:$PATH

While executing the pipeline I get the following error:

Using "assword" as the default password prompt indicator.
$ sshpass -p '$FTP_PASSWORD' rsync --progress -avz -e ssh . $FTP_USERNAME@$HOST:$PATH
sshpass: Failed to run command: No such file or directory

I already tried out various things but none we're working. Does anyone have an idea what is going wrong here?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
fklement
  • 63
  • 8
  • The "no such file or directory" response would seem to indicate that rsync is not actually installed in the gitlab runner. – Gimby Sep 25 '19 at 11:15

1 Answers1

1
  • Hope this this article helps, I have not used rsync but scp should do the work.
  • gitlab secret variable can be used for USER_PASS
script:
    - export SSHPASS=$USER_PASS
    - sshpass -e scp -o stricthostkeychecking=no -r directory-to-copy user@host:path-to-copy-files-to
amittn
  • 2,249
  • 1
  • 12
  • 19
  • Maybe it is important to say that the `-o stricthostkeychecking=no` does most of the trick. As `scp` can use different known_hosts file from `ssh` it can be reason why you get very confusing message: `no such file or directory`. – Majlanky Jul 31 '22 at 15:29