Search code examples
commandgitlabscpgitlab-ci-runner

Use SCP command on Windows gitlab runner


In my gitlab-ci.yml, i wrote :

deploy:
    stage: build
    script:
        - scp target/ROOT.war user@host/data/temp

But my Windows GitLab-ci runner throws an error :

scp is not recognized as an internal or external command

Do you know if it's possible to add scp package to the runner or something like that ?


Solution

  • scp.exe is packaged with any of the latest distribution of Git for Windows:

    vonc@VONCAVN7 C:\Users\vonc
    > where scp
    D:\prgs\git\latest\usr\bin\scp.exe
    

    If your GitLab agent has in its %PATH% the <installation path of Git>/usr/bin, it will have scp.

    The OP GGO details in the comments:

    In fact I added the git /usr/bin path in system path var (and not user path var) and recreated my runner instead of using set command.
    It works!