Jenkins Git plugin detached HEAD

后端 未结 9 2079
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 09:55

I am new to Git and also to Jenkins. My problem is that I can\'t get the Jenkins Maven release plugin to work.

When I build a common Maven build with Jenkins, it wor

9条回答
  •  没有蜡笔的小新
    2020-12-02 10:06

    I had the same problem. I tried Constantine's solution, that worked perfectly but the tag and the commits were pushed on the "localbranchname" remote repository.

    So I did the same but manually : first add a pre-steps shell script :

    git branch -f localJenkins
    git checkout localJenkins
    

    Then a post-steps shell script :

    git checkout master
    git rebase localJenkins
    git branch -D localJenkins
    git push origin master
    git push --tag
    

    This works ! This way, you don't have jenkins remote branch, commits and tag will be on the master (or other) branch.

    hope this helps !

提交回复
热议问题