How to access git local repository (in Centos) from jenkins which is running as container on same ma

krishna April 20, 2018

I have git local repository on Centos and jenkins as container on same machine. How to provide the git path in jenkins job to access it.

Please guide me.

1 answer

0 votes
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2018

Hi Krishna,

You can use a volume when starting the Jenkins container.

Use volumes

Then start the jenkins container with 

-v <path-to-centos-repo>:<path-to-jenkins-repo>

Then in Jenkins you can reference the repo with

/path/to/repo.git

file:///path/to/repo.git

Screen Shot 2018-04-20 at 23.55.05.png

krishna April 26, 2018

Thank you for your support.

krishna April 26, 2018

1. jenkins container

docker run --name Jenkins_Linux -d -p 9091:8080 jesusperales/jenkins-docker-run-inside

2. Bit bucket container 

docker volume create --name bitbucketVolume

docker run -v bitbucketVolume:/var/atlassian/application-data/bitbucket --name="bitbucket" -d -p 7990:7990 -p 7999:7999 atlassian/bitbucket-server

Both are up and running on same centos machine. How can I access the git path in jenkins job?

Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2018

Krishna,

It would be best to install the Bitbucket plugin in Jenkins.

BitBucket Plugin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events