开发者

Is there a way to update config files once build is done in jenkins

开发者 https://www.devze.com 2023-03-21 13:26 出处:网络
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 arebuilding one build and updating Config files using Xmlpoke a

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

精彩评论

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

关注公众号