mcho
mcho

Reputation: 11

Fatal error when calling git from bash script in Jenkins

I have a Jenkins CI server setup on Ubuntu machine. In Jenkins there is a free style job setup. What the job does is that it checks out bash scripts from svn and tries to run them. Inside the bash script there are calls to git, which should clone the git repository. The bash script either exits with an error:

git clone git://gitorious.org/qt/qt.git
Initialized empty Git repository in /var/lib/jenkins/jobs/build/workspace/qt/.git/
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Build step 'Execute shell' marked build as failure
Finished: FAILURE

either hangs up at the cloning step.

When I login as a superuser, I can run the same git command without any problems.

Upvotes: 0

Views: 1027

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328840

Don't clone as root - it will leave files behind which only root can modify.

For your tests, clone as the same user under which Jenkins is running later.

Upvotes: 1

Related Questions