首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >. Gitlab -ci.yml Gitlab部署SFTP无效

. Gitlab -ci.yml Gitlab部署SFTP无效
EN

Stack Overflow用户
提问于 2018-09-04 02:18:12
回答 2查看 2.8K关注 0票数 0
代码语言:javascript
复制
deploy:
  stage: deploy
  script:
    - apt-get update -qq && apt-get install -y -qq lftp
    #- lftp -u $DEPLOY_USER,$SFTP_PASSWORD $DEPLOY_HOST -e "mirror -e -R -p ./dist/ new/ ; quit"
    - lftp -c "set ftp:ssl-allow no; debug; open -u root,$DEPLOY_PASSWORD -p 22 $DEPLOY_HOST; mirror -Rev ./ gitlab --verbose --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
    - echo "deployment complete"
  # specify environment this job is using
  environment:
    name: staging
    url: https://xxxxxxxx.de/
  # needs artifacts from previous build

为什么前面的.gitlab-ci.yml会创建以下错误?

新故障->

代码语言:javascript
复制
--verbose --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
---- Running connect program (ssh -a -x -s -l root xx.xx.xxx.xx sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- The authenticity of host 'xx.xx.xxx.xx (xx.xx.xxx.xx)' can't be established.
<--- ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxx+xxxxxxxxxxxxxx.
<--- Are you sure you want to continue connecting (yes/no)? no
<--- 
<--- Host key verification failed.
---- Disconnecting
---- Running connect program (ssh -a -x -s -l root xx.xx.xxx.xx sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- The authenticity of host 'xx.xx.xxx.xx (xx.xx.xxx.xx)' can't be established.
<--- ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx.
<--- Are you sure you want to continue connecting (yes/no)? no
<--- 
<--- Host key verification failed.
mirror: Fatal error: Host key verification failed.
---- Disconnecting
ERROR: Job failed: exit code 1
EN

回答 2

Stack Overflow用户

发布于 2018-09-04 02:28:09

您已经设置了ftp:ssl-allow no,但是您正在连接到端口22,这很可能是一个SSL服务。

假设您打算在连接中使用SSL。尝试:set ftp:ssl-allow true;作为lftp命令的一部分。

lftp手册页指出:

FTP : SSL -允许(布尔值)如果为真,请尝试与FTP服务器协商SSL连接,以进行非匿名访问.默认值是真的。只有在使用ssl/tls库编译lftp时,此设置和其他SSL设置才可用。

票数 2
EN

Stack Overflow用户

发布于 2018-09-04 06:26:14

lftp -c“设置ftp:ssl-不允许;调试;打开-u root,$DEPLOY_PASSWORD -p 22 $DEPLOY_HOST…”

第一,删除set ftp:ssl-allow no;或将其设置为yes

第二,您在标题和使用端口22中提到了" SFTP“;协议SFTP不是 FTP,它是一种完全不同的协议;要使用它,您必须使lftp使用带有sftp://协议的URL来使用协议:

代码语言:javascript
复制
lftp -c "debug; open -u root,$DEPLOY_PASSWORD sftp://$DEPLOY_HOST…"
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52157959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档