如何在jenkins构建完成后将更改推送到github? [英] How to push changes to github after jenkins build completes?
问题描述
我有一个jenkins作业,它从github克隆了存储库,然后运行powershell脚本来增加文件中的版本号。我现在试图将该更新文件发布回github上的原始存储库,因此,当开发人员修改更改时,他会获得最新的版本号。
我尝试使用Git发布者在发布后生成事件中,我可以发布没有问题的标签,但它似乎并未发布任何文件。
基本上需要执行:
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屋!