Is there a way to update config files once build is done in jenkins
I am new to jenkins, I开发者_开发百科 am working on .NET Project.
Right now we are using CC.NET with combination of NANT for our CI. We are building one build and updating Config files using Xmlpoke as required by environment (qa,prod) .
I am able to compile my code in jenkins with MS build and Sln file combination , But stuck at config files update before deploy?
For example , I have to update below portion of webconfig file :
From :
<endpoint address="http://cmwebservice/CreditWebService.svc/Get/"
behaviorConfiguration="WebBehavior" binding="webHttpBinding"
contract="Credit.WebServiceHost.ICreditWebService">
</endpoint>
To
<endpoint address="http://somewebserver/CreditWebService.svc/"
behaviorConfiguration="WebBehavior" binding="webHttpBinding"
contract="Credit.WebServiceHost.ICreditWebService">
</endpoint>
Make your config file into a template:
<endpoint address="ENDPOINT_ADDRESS"
Then you can use a pre-build or post-build "Execute shell" command to perform the replacement:
sed -i 's/replaceThis/withThis/g' $WORKSPACE/path.to.file
精彩评论