繁体   English   中英

Git 与 Jenkins 集成

[英]Git integration with Jenkins

我正在创建一个 Jenkins 管道。

但是在管道中,当我 select Git 并提供存储库时,它给了我以下错误

无法连接到存储库:执行命令时出错:git ls-remote -h https://github.com/trushant-dw/aushitosh.ZBA9F11ECC3497D9993B933FDC2BD6E

我已在 gobal 凭据中添加了我的 git 凭据,但仍不确定为什么会引发此错误。

下面是我的管道

node {
    stage 'Checkout'
        git 'git@github.com:trushant-dw/dockerwebapp.git'
    stage 'Docker build'
        docker.build('demo-docker')
    stage 'Docker push'
        docker.withRegistry('https://944198216610.dkr.ecr.us-east- 
        1.amazonaws.com', 'ecr:us-east-1:demo-ecr-credentials') {
            docker.image('demo').push('latest')
        }
}

我在我的 jenkins 服务器中安装了 git。

$ yum install git
$ which git
  /usr/lib/git

然后在管理 Jenkins ---> 全局配置工具 ----> Git 我添加了路径。它对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM