pipeline项目中源代码变更自动触发构建

之前pipeline运行在pod中,基于jenkins kubernates的插件,在pod中实现

下载源码--->编译代码--->生成镜像--->上传镜像的功能。后面需要加入当源代码实现变更的时候自动触发构建。

pipeline项目中源代码变更自动触发构建_第1张图片

遇到的一些问题:

在测试git时出现的问题:

1、stderr: fatal: Unable to find remote helper for 'http'

找到libexec/git-core所在路径,将该路径加入到path中,注意看该路径下面是否有git-remote-http,如果没有说明git安装不完整。如果有的话就加入到path下即可

2、hudson.plugins.git.GitException: Command "git fetch --tags --progress git@*******.git +refs/heads/*:refs/remotes/origin/*" returned status code 128

将jenkins所在主机的生成ssh-keygen,ssh-keygen -t rsa -C"YourEmail",将cat ~/.ssh/id_rsa.pub中的内容放到gitlab中就可以

你可能感兴趣的:(pipeline项目中源代码变更自动触发构建)