0

无法在 GIT 运行器中使用 cf login 作为 shell 登录到 cf

$ cf login -a api.sys.xxx.pcf.xxx.com -u xxxxx -p xxxxx -o xxx -s xx --skip-ssl-validation

API endpoint: api.sys.xxx.pcf.xxx.com
Authenticating...
Credentials were rejected, please try again.
Authenticating...
Credentials were rejected, please try again.
Authenticating...
Credentials were rejected, please try again.

API endpoint:   api.sys.xxx.pcf.xxx.com (API version: 2.103.0)
Not logged in. Use 'cf login' to log in.
FAILED
Unable to authenticate.

我能够执行相同的命令并成功通过 Windows Powershell 进行身份验证。但是对于 GIT-CICD yml 文件,我正在尝试执行上述命令并且无法正常工作。

Runner is configured in Windows as shell and shell = "Powershell"
below is the .toml file configuration
[[runners]]
  name = "Test PCF deployment"
  url = "https://Git Path"
  token = "xxxxxxxxxxxxxxxxxxxxxxxx"
  executor = "shell"
  shell = "PowerShell"
  [runners.cache]  

任何建议都会有很大帮助。

4

1 回答 1

0

我认为您遇到了一个长期存在的已知问题。

在 Windows 上的 Cygwin 和 Git Bash 中,交互式密码提示(在 cf login 中)不起作用(问题 #171)。请使用替代命令(cf api 和 cf auth 到 cf login)来解决此问题。

https://github.com/cloudfoundry/cli#known-issues

于 2018-07-27T20:19:34.563 回答