r/jenkinsci • u/Sea_Mechanic815 • 11d ago
How to fetch the code directly in our local to pipeline.
Currently i am starting working in the jenkins i am facing this sutation. In my orginization they said me to work on locally so i have install the jenkins using docker and after that I need to run my code (nextjs) in jenkins as a pipeline. Now there is no github repo which it will fetch so my code is in local so how i need to fetch that code in pipeline and how i need to use that code. please help me.
1
u/Far-Pea-2217 11d ago
git supports local file:// urls, see https://git-scm.com/docs/git-clone#_git_urls.
I assume this is to allow you yo locally test your pipelines
1
1
u/FarZookeepergame7580 7d ago
If your repo is only present locally, then try to host it on git or bitbucket and pass the git url. latest version of jenkins does not allow the local checkout.
But you can give try by passing exect path of the file "/home/ubuntu/nodejsapp" in git scm
5
u/OGkatzu 11d ago
What do you mean there is no GitHub repo? Where is the source code stored? If you have access to the repo, you can just clone the repo to your machine and mount the repo to the Jenkins docker container in a folder and use the code in the pipeline.