I would like to set up a parameterized build so the user can select branch and then press "build" to build that branch.
In configure I have added a git parameter "branch", like this:

I have then added the "branch" parameter as branch specifier in the pipeline definition like this:

When I start the build, I can select the branch without a problem. In this example /origin/feature/kvarntorp-test1. But the build will fail with the following console output:
Started by user xxxx Lightweight checkout support not available, falling back to full checkout. Checking out git ssh://gitolite@tuleap.ermms.se/ermms/acm.git into /var/lib/jenkins/workspace/6smCustomBuild@script to read ci/jenkins/6msBuildAndTest.groovy
> git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository
> git config remote.origin.url ssh://gitolite@tuleap.ermms.se/ermms/acm.git # timeout=10 Fetching upstream changes from ssh://gitolite@tuleap.ermms.se/ermms/acm.git
> git --version # timeout=10 using GIT_SSH to set credentials
> git fetch --tags --progress ssh://gitolite@tuleap.ermms.se/ermms/acm.git +refs/heads/:refs/remotes/origin/
> git rev-parse /origin/feature/kvarntorp-test1^{commit} # timeout=10
> git rev-parse refs/remotes/origin//origin/feature/kvarntorp-test1^{commit} # timeout=10
> git rev-parse /origin/feature/kvarntorp-test1^{commit} # timeout=10ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE
So Jenkins can not find the branch /origin/feature/kvarntorp-test1 because he is searching for /origin/feature/kvarntorp-test1^{commit}
Where did ^{commit} come from? Can I somehow remove the ^{commit} in the build configuration? Have I configured the build wrong?
I have tried different names instead of "branch". Git PullRequest job failed. Couldn't find any revision to build. Verify the repository and branch configuration for this job suggests I should use sha1 with the default value "master". I tried sha1 as Git Parameter Name and ${sha1} as Branch Specifier. The build failed with the following console output:
hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${sha1}:refs/remotes/origin/${sha1} --prune" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/${sha1}
fatal: The remote end hung up unexpectedly
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2002)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1721)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:351)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:298)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE