Use jenkins subversion credential in my groovy script Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Use jenkins subversion credential in my groovy script without wasting too much if your time.

The question is published on by Tutorial Guruji team.

As part of the build process, I need to check in a file after changing it. I can do it with a groovy script but I have to put the username password in the script. I want to try to avoid it if it’s possible. Is there a way to use the credential already stored in Jenkins Source Code Management section in my groovy script?

Answer

There is no way to do this that I know of, but you can accomplish essentially the same thing using a batch or shell script with the SVN command line client.

You will have to preform a checkout or commit once by hand on all your slaves, but once you do this the credentials will be cached on that machine and you can use them in your jobs via batch or shell commands without a user or password.

This isn’t ideal, but it does get the job done.

We are here to answer your question about Use jenkins subversion credential in my groovy script - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji