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

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

问题描述

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



我尝试使用Git发布者在发布后生成事件中,我可以发布没有问题的标签,但它似乎并未发布任何文件。 自己找到了答案,这个博客帮助: http:// thingsyoudidntknowaboutjenkins。 tumblr.com/post/23596855946/git-plugin-part-3



基本上需要执行:

  git checkout master 

修改任何文件

然后

  git commit -am更新版本号

修改后的文件



然后使用使用opti发布Git Publisher的后续操作合并结果,这将推动对成功构建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.

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.

解决方案

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

Basically need to execute:

git checkout master

before modifying any files

then

git commit -am "Updated version number"

after modified files

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天全站免登陆