这是我的.gitlab-ci.yml文件:
before_script:
- sudo apt-get install -y python-pip
- pip install fabric
staging:
type: deploy
script:
- fab -f fab_crawler start:test
only:
- test
production:
type: deploy
script:
- fab -f fab_crawler start:dev
only:
- master
这是我在/etc/gitlab-runner
中的gitlab-runner配置文件:
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "xxx"
url = "xxx"
token = "xxx"
executor = "ssh"
[runners.ssh]
user = "root"
host = "80.xxx.xxx.xx6"
port = "xxxx"
identity_file = "/root/.ssh/id_rsa"
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
当我把东西推到测试分支时,在作业中我得到了这个错误:
Running with gitlab-runner 11.6.0 (f100a208)
on xxx XMdAz8un
Using Shell executor...
Running on gitlab-runner...
Fetching changes...
HEAD is now at eaffd0f Remove unwanted functions
Checking out eaffd0f2 as test...
Skipping Git submodules setup
$ sudo apt-get install -y python-pip
sudo: no tty present and no askpass program specified
ERROR: Job failed: exit status 1
我还将gitlab-runner ALL=(ALL) NOPASSWD: ALL
添加到/etc/sudoers
文件的底部,但它没有工作this问题也有这个问题。这是奇怪的是我在配置文件中使用ssh
运行器,但gitlab-ci执行器说Using Shell executor...
?
您的身份文件(/root/.ssh/id_rsa)密码是否受到保护?