jenkins构建完成后如何将更改推送到github? [英] How to push changes to github after jenkins build completes?

查看:27
本文介绍了jenkins构建完成后如何将更改推送到github?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 jenkins 作业,它从 github 克隆存储库,然后运行 ​​powershell 脚本来增加文件中的版本号.我现在正在尝试将该更新文件发布回 github 上的原始存储库,因此当开发人员提取更改时,他会获得最新版本号.

I have a jenkins job that clones the repository from github, then runs the powershell script that increments the version number in the file. I'm now trying to publish that update file back to the original repository on github, so when developer pulls the changes he gets the latest version number.

我尝试在后期构建事件中使用 Git Publisher,我可以毫无问题地发布标签,但它似乎没有发布任何文件.

I tried using Git Publisher in the post build events, and I can publish tags with no issues, but it doesn't seem to publish any files.

推荐答案

自己找到了一个答案,这个博客有帮助:http://thingsyoudidntknowaboutjenkins.tumblr.com/post/23596855946/git-plugin-part-3

Found an answer myself, this blog helped: http://thingsyoudidntknowaboutjenkins.tumblr.com/post/23596855946/git-plugin-part-3

基本需要执行:

git checkout master

修改任何文件之前

然后

git commit -am "Updated version number"

修改后的文件

然后使用Git Publisher 的构建后操作,并带有一个合并结果选项,这将在构建成功时将更改推送到 github.

and then use post build action of Git Publisher with an option of Merge Results which will push changes to github on successful build.

这篇关于jenkins构建完成后如何将更改推送到github?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆