【发布时间】:2022-01-17 04:52:58
【问题描述】:
我正在尝试将我的第一个项目部署到我的生产服务器。这是部署阶段的脚本:
deploy_production:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "ssh -p 69" "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ./vendor/bin/envoy run deploy
environment:
name: production
when: manual
only:
- main
当我运行舞台时,我得到了这个错误:
[myServer@xxx.xxx.x.x]: /home/php/.ssh/config: line 1: Bad configuration option: ssh
[myServer@xxx.xxx.x.x]: /home/php/.ssh/config: terminating, 1 bad configuration options
[âœ-] 此任务未在您的一台服务器上成功完成。
为什么它试图访问此路径上的SSH:
/home/php/.ssh/config
【问题讨论】: