【问题标题】:It' s possible to works SSH and git command in gitlab-ci?可以在 gitlab-ci 中使用 SSH 和 git 命令吗?
【发布时间】:2021-08-16 20:22:29
【问题描述】:

在我的 gitlab-ci.yml 中,我有一个到另一台服务器的 SSH 连接,我的所有命令都在工作,除了 git 命令

他们用消息阻止脚本:

WARNING: terminal is not fully functional
-  (press RETURN) 

我的脚本被阻止了

我在 gitlab-ci 中的代码:

  allow_failure: false
  script:
    - ssh  -tt root@1IP 'cd PATH; git branch;docker run  -it -v $PWD:PATH -w /PATH cypress/included:6.5.0 | tee  result.txt'

没有 git 命令,它的工作。

当然,在我的远程服务器中,git branch 工作正常。

有什么想法吗?

谢谢:) :)

【问题讨论】:

    标签: shell ssh gitlab-ci gitlab-ci-runner


    【解决方案1】:

    这是来自 Git 的 less, used as a pager 的错误消息,as I documented here

    试试:

     git config --global core.pager "less -d"; git branch; ... (rest of the commands)
    

    -d 选项(来自less man page)选项抑制了终端为哑时通常显示的错误消息;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-14
      • 2018-07-05
      • 2019-06-10
      • 1970-01-01
      • 2020-02-15
      • 1970-01-01
      • 2019-06-24
      相关资源
      最近更新 更多