开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜