6

I'm trying to find the directory where jenkins stores the git repository, I need to be able to setup the AWS dev tools so I can run the shell command to aws.push up to beanstalk. For some reason the directory with the working files appears to have incorrect branch info associated with it.

jenkins@192.168.1.1:~/jobs/myPHPapp/workspace$ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   default/

The branch jenkins imports from github is my 'dev' branch, weird that it only shows master. Does Jenkins save another copy of the repository elsewhere?

greg
  • 6,853
  • 15
  • 58
  • 71

3 Answers3

9

You've got that right, Jenkins clones git repository to the job workspace in ${JENKINS_HOME}/jobs/<JOB_NAME>/workspace

You should try clearing the workspace and then starting another build. If that helps you can set up Jenkins to automatically clear the workspace after the build is done. If that doesn't help, you have to carefully inspect the console output that this job generates and maybe post it if you need further assistance.

Marcin Koziński
  • 10,835
  • 3
  • 47
  • 61
  • Thank you. For some reason it says it's on Master branch even though i've specified it to grab the dev branch. The files are all correct so I'm pushing up to EC2 and it seems to be working correctly. – greg Jul 19 '12 at 16:15
  • Has this changed since 2012? I'm getting a 404. – Simon Jun 26 '18 at 21:04
2

As of Feb 2020, Jenkins stores the git repository in /var/lib/jenkins/workspace/folderName_jobname

(Jenkins 2.... on Ubuntu 18.04 LTS)

Nisarg
  • 1,631
  • 6
  • 19
  • 31
vberry
  • 19
  • 6
0

On the jenkins container the actual location is

/var/jenkins_home/workspace/repo_name

Note: If you are doing a cleanup operation, it will not appear but a repo_name@tmp will.

Dave
  • 727
  • 1
  • 9
  • 20