简体   繁体   English

在构建期间如何最好地将构建更改提交回Jenkins的GIT分支

[英]How best to commit build changes back to GIT branch in Jenkins during build

Here's my current process: 这是我当前的流程:

  1. I checkout a repo using the jenkins git plugin (no branching, just a checkout) 我使用jenkins git插件签出回购协议(没有分支,只是签出)
  2. In the build steps make multiple changes to source files, including sometimes creating new files 在构建步骤中,对源文件进行多次更改,包括有时创建新文件
  3. Run a exec shell build step git add -A && git commit -m "blahblahblah" 运行exec shell构建步骤git add -A && git commit -m "blahblahblah"
  4. In the post build steps, use git publisher to push changes back to origin 在构建后的步骤中,使用git Publisher将更改推回原点

Step #3 doesn't seem right. 步骤3似乎不正确。 My hunch is the git plugin should have a way to run add/del/commit commands, but can't find a way in the build steps or the post build steps. 我的直觉是git插件应该可以运行add / del / commit命令,但是在构建步骤或后期构建步骤中找不到方法。

Am I doing this the only way possible? 我是否只能这样做?

从注释链和我自己的搜索来看,在显式exec shell构建步骤中执行此操作似乎是唯一有效的方法。

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

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