开发者

How to share the same K2 server for both dev and testing?

I am working on K2 Blackperl project, and we share one K2 server for both development and testing. I deploy the 2 web sites for dev and testing and connect to dev database and test data base, it is no problem. And then I need to deploy the one K2 process to K2 server 2 times. one for dev and another one for testing. the problem coming: The application get the DBConnectionstring from Web.config, and K2 process called applcation dll. the K2 process running on the K2 server, the dll will auto check the DBConnectionString from K2HostServer.config. but for both dev process and test process will link to same key in K2HostServer.config (e.g. DBConnectionString). I can not config the DB connection string to link both Dev and Test.

After research I got 2 options to fix the issue, but both looks not good:

Option 1: Update the application data access code, e.g. for dev environment, we update the code to link to *Dev*DBConnectionString. For test environment, we update the code to link to *Test*DBConnectionString, we put both 2 keys in K2Host开发者_如何学JAVAServer.config. and then Dev process and dll can link to dev database, test process and dll can link to test database.

Option 2: Use K2 environment parameter. we can define the environment in K2 and send the DBConnectionString to dll by parameter. but it is need update lot of existing web application code. add the DBConnectionString parameter to each methord and don't read it from Web.config.

Guys, do you have some good idea about this?


I would highly recommend creating two K2 virtual machines: one for dev, one for test. This way you have a clear separation of duties, and won't get into any messes like this.

The K2 server is not designed to run as per your requirement.

Murray Macdonald K2Insider

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜