我正在尝试使用Deployer设置Gitlab CI/CD
我的Symfony
项目,但我无法做到。在我的管道上执行部署时,我有一个这意味着我的配置是错误的。Operation timed out error
我的 gitlab-ci.yml :
image: php:7.4-cli-alpine
stages:
- deploy
before_script:
- apk add --update git openssh-client
- mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | ssh-add -
deploy:
stage: deploy
script:
- curl --show-error --silent https://getcomposer.org/installer | php
- php composer.phar install -d app/
- app/vendor/bin/dep deploy dev -vvv
environment:
name: prod
我的 hosts.yml 库存:
dev-server.com:
stage: dev
hostname: XX.XXX.XX.X
user: deployer
branch: develop
identityFile: ~/.ssh/gitlab
deploy_path: /var/www/recruitment_back
keep_releases: 1
我的 Gitlab 管道错误:
$ app/vendor/bin/dep deploy dev -vvv
✈︎ Deploying develop on XX.XXX.XX.X
• done on [dev-server.com]
➤ Executing task deploy:prepare
[dev-server.com] > export APP_ENV='prod'; echo $0
[dev-server.com] < ssh multiplexing initialization
[dev-server.com] < ssh: connect to host XX.XXX.XX.X port 22: Operation timed out
➤ Executing task deploy:failed
• done on [dev-server.com]
✔ Ok [0ms]
我还在设置中添加了变量SSH_PRIVATE_KEY
,还在我的服务器上Gitlab CI/CD
添加了我的公共 ssh 密钥。authorized_keys
在我的本地机器上执行部署工作良好。
我的配置有什么问题?