1
votes

I have a jenkins instance running on a docker container, currently i'm utilizing 'Pipeline script from SCM' option for providing Jenkins pipeline scripts. Is there any way , that I could keep my jenkinsfile in the same container as my jenkins instance and use it everytime I trigger a job using that jenkins instance , instead of hosting it outside in some SCM and pulling it each time I trigger a job

1
Use the regular Pipeline project type; there's an option to define the Jenkinsfile contents in the project configuration. - wmorrell
Are you planning to change Jenkinsfile directly on the Jenkins server? Ideally Jenkinsfile should be in the source code/repo . Any specific reason for taking it out of repo? - vivekyad4v
I think that actually goes against the pipeline as code philosophy, which allows you to control WHAT and HOW to deploy from inside the repo - omu_negru

1 Answers

0
votes

You can create a local git repository in the same container as your Jenkins instance, commit your scripts there and then in the field Pipeline script from SCM -> Git -> Repository URL put a file URI of your local repository (for example file:///c/Users/Vitalii/repositories/jenkinsPipelines).