I am trying to run a python project through Jenkins. I am providing some connection details to the project through a .properties file. It works absolutely fine when I directly run it in code editor or command prompt. Where as, when I try to run the same through Jenkins (installed locally in my Windows machine), it throws error for the function which reads the .property file, saying FileNotFoundError: [Errno 2] No such file or directory. Can anyone suggest, how can I can I make it work.
Asked
Active
Viewed 168 times
0
-
Can you verify that the .properties file is located in the workspace of the Jenkins job you are running? https://stackoverflow.com/a/34918545/5630865 – von_court May 02 '21 at 19:50
-
It wasnt there. So I manually copied it to there. But I want to know, how to copy using winodows batch command. So that each time I change the property file, it automatically gets copies to the Workspace while taking the build. – Matru Prasad May 03 '21 at 06:50
-
You could try out the Credentials Binding plugin and use its "secret file" option to select your .properties file and inject that secret . In case this would be static (didn't test it myself yet) and you definitely want it to be dynamically updated on each build, IMO you could try the following alternative: https://stackoverflow.com/a/49466478/5630865 – von_court May 03 '21 at 07:08