Jenkins + Git Publisher - 如何回到{GIT_BRANCH}?

mtu*_*tty 9 git jenkins

我在Jenkins 1.500上使用当前版本的Git插件(SCM提供程序和发布者).SCM轮询工作正常,使用我的git HTTP URL和"branches to build"设置"feature-*".这将获取对任何分支的更改,例如"feature-1234",运行构建/测试/覆盖任务,并报告成功或失败.所有这一切都运行正常,包括集成分支的合并,代码应该在成功构建和代码审查后结束.

问题是在同一个"feature-1234"分支上尝试将已完成的构建分支BACK推送到原点.在这种情况下,构建变量"GIT_BRANCH"包含"origin/feature-1234",在其他成功构建之后,它会在Git Publisher中产生以下错误和失败:

Pushing HEAD to branch origin/feature-1234 at repo origin
ERROR: Failed to push branch origin/feature-1234 to origin
hudson.plugins.git.GitException: Command "/usr/bin/git push https://jenkins:jenkinsPWD@myproject.com/git/project HEAD:origin/feature-1234" returned status code 1:
stdout: 
stderr: error: unable to push to unqualified destination: origin/feature-1234
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'https://jenkins:jenkinsPWD@myproject.com/git/project'

    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:897)
    at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:858)
    at hudson.plugins.git.GitAPI.push(GitAPI.java:915)
    at hudson.plugins.git.GitPublisher$4.invoke(GitPublisher.java:351)
    at hudson.plugins.git.GitPublisher$4.invoke(GitPublisher.java:333)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:333)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
    at hudson.model.Run.execute(Run.java:1582)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:236)
Build step 'Git Publisher' changed build result to FAILURE
Build step 'Git Publisher' marked build as failure
Run Code Online (Sandbox Code Playgroud)

在那里看到额外的"起源"?origin/feature-1234 <==这是$ {GIT_BRANCH}的当前值,虽然我知道它是一个远程分支,但它阻止了我运行我们想要遵循的过程.

如果我遗漏了一些简单的东西,我很乐意听到它.但是我已经为构建的各种git相关部分尝试了许多不同的设置,似乎没有任何东西允许我将合并和测试的代码提交回工作分支(而不是集成分支,这很容易做到).

Mar*_*s K 1

对我来说,一个解决方法似乎是手动推送分支,至少每次都相同时。