代码之家  ›  专栏  ›  技术社区  ›  GGO

在Windows gitlab runner上使用SCP命令

  •  1
  • GGO  · 技术社区  · 7 年前

    在我的 gitlab-ci.yml ,我写道:

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

    但我的Windows GitLab ci runner抛出了一个错误:

    scp 无法识别为内部或外部命令

    您知道是否可以添加 scp公司 给跑步者的包裹之类的?

    1 回复  |  直到 7 年前
        1
  •  1
  •   VonC    6 年前

    scp.exe 与任何 latest distribution of Git for Windows :

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

    如果您的GitLab代理在其 %PATH% 这个 <installation path of Git>/usr/bin ,它将具有 scp .

    这个 OP GGO 细节 in the comments :

    事实上,我添加了git /usr/bin 系统路径var(而不是用户路径var)中的路径,并重新创建了我的跑步者,而不是使用 set 命令
    它起作用了!