1
votes

I am new to Jenkins and want to build a CI-environment. I have a local repository with files to get built by Ant.

when I start the build manually I get this errors:

Building in workspace C:\ProgramData\Jenkins\workspace\ToolchainXQT

C:\Git\git-cmd.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository C:\Git\git-cmd.exe config remote.origin.url file:///C:/HelloWorld # timeout=10 Fetching upstream changes from file:///C:/HelloWorld C:\Git\git-cmd.exe --version # timeout=10 C:\Git\git-cmd.exe fetch --tags file:///C:/HelloWorld +refs/heads/:refs/remotes/origin/ C:\Git\git-cmd.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 FATAL: Invalid id: C:\ProgramData\Jenkins\workspace\ToolchainXQT> org.eclipse.jgit.errors.InvalidObjectIdException: Invalid id: C:\ProgramData\Jenkins\workspace\ToolchainXQT> at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:232) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:689) at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316) at hudson.plugins.git.util.DefaultBuildChooser.getHeadRevision(DefaultBuildChooser.java:130) at hudson.plugins.git.util.DefaultBuildChooser.getCandidateRevisions(DefaultBuildChooser.java:112) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:992) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1095) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1728) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Finished: FAILURE

When I leave the branch specifier blank, then I get this:

Building in workspace C:\ProgramData\Jenkins\workspace\ToolchainXQT

C:\Git\git-cmd.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository C:\Git\git-cmd.exe config remote.origin.url file:///C:/HelloWorld # timeout=10 Fetching upstream changes from file:///C:/HelloWorld C:\Git\git-cmd.exe --version # timeout=10 C:\Git\git-cmd.exe fetch --tags file:///C:/HelloWorld +refs/heads/:refs/remotes/origin/ Seen 0 remote branches ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE

I hope someone can help me, explain me this messages or tell me what you need to know to help me.

Thanks in advice, Max

2
can you try to do a clone in local : git clone C:\ProgramData\Jenkins\workspace\ToolchainXQTInforedaster
max@ToolchainXQT MINGW64 /c/ProgramData/Jenkins/workspace/ToolchainXQT (master) $ git clone C:/HelloWorld Cloning into 'HelloWorld'... warning: You appear to have cloned an empty repository. done. That's the output from git-bash opnened in C:\ProgramData\Jenkins\workspace\ToolchainXQTMax R.

2 Answers

0
votes

so you have a empty repository you must create a available git repository so your repo directory you do

git init

you add your files do

git add .

git commit -m "inital git repo"

in first time try to clone your repo from other consol by git clone if it works go a head to Jenkins and enjoy

1
votes

Refer to https://stackoverflow.com/a/44847857/3043709 for a description why you should use git.exe from the cmd or the bin directory, instead of git-cmd.exe.