首页 > 解决方案 > 致命:无法读取“https://gitlab.com”的用户名:gitlab 上没有这样的设备或地址

问题描述

我正在尝试通过自动部署和拉取过程将代码推送到生产服务器,但是在管道构建过程中出现这样的错误

fatal: could not read Username for 'https://gitlab.com': No such device or address

这里有一个.gitlab-ci.yml

script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$PRIVATE_KEY_STAGING" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh -p22 ec2-user@$SERVER_STAGING "uname -a"

如何使用 Gitlab CI/CD 登录到我的服务器并提取我更新的代码?

提前致谢

标签: linuxgitcontinuous-integrationgitlabdevops

解决方案


推荐阅读