Modify custom properties file

43 views
Skip to first unread message

uzqat...@gmail.com

unread,
Feb 11, 2015, 12:10:41 PM2/11/15
to jenkins...@googlegroups.com
Hi,

I have a custom properties file where i have some variables, now i need change it but i don't know how to modify this file. I tried some shell script and jenkins plugins but it doesn't work to me. Any idea how to do it? 

I am working with a Windows Server 2008 R2 and the file is at C:\jenkins\currentBrowser.properties and the content is just browser = explorer

Thanks

Ioannis Moutsatsos

unread,
Feb 21, 2015, 7:13:08 AM2/21/15
to jenkins...@googlegroups.com
If this file is in standard key-value format then it's a standard Java properties file.
You can write a small groovy script that you can execute from the Jenkins script console to read, modify it and re-save it.

I have a groovy scriptlet that reads a particular property key from a properties file on the Jenkins server. Maybe you can modify it to do what you want.

Hope this helps
Ioannis
Reply all
Reply to author
Forward
0 new messages