我有一个用jenkins构建的聚合器项目,我想发布一个包含项目版本控制的文件:
app.version=1.1
每次构建时,值都会增加,因此文件会被修改,我需要提交并将文件推送到git存储库。
我使用“分支”配置添加“后构建操作”:http://postimg.org/image/mtz6czv0l/
构建(git clone和generate war)运行正常,但是此后期操作不添加并将文件推送到git。
如果我检查工作区文件,则在构建后进行更改:
$ git status
HEAD detached at a0cde37
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: application.properties
no changes added to commit (use "git add" and/or "git commit -a")
日志显示正确:
Done creating WAR target/radar-varejo-1.1.war
> git tag -l jenkins-radar-varejo-32 # timeout=10
> git tag -a -f -m Jenkins Build #32 jenkins-radar-varejo-32-SUCCESS # timeout=10
Pushing HEAD to branch develop at repo origin
using .gitcredentials to set credentials
> git --version # timeout=10
> git config --local credential.helper store --file=/tmp/git8741248240629941444.credentials # timeout=10
> git -c core.askpass=true push http://192.168.10.107:8083/morro-das-pedras/radar-varejo.git HEAD:develop -f
> git config --local --remove-section credential # timeout=10
我怎么做?任何的想法? 谢谢!