How to maintain custom configurations for project in different environments? | Adobe Higher Education
Skip to main content
Level 3
October 16, 2015
解決済み

How to maintain custom configurations for project in different environments?

  • October 16, 2015
  • 7 の返信
  • 2060 ビュー

Hi,

I have 2 different projects/sites with two separate code base. I have some custom configurations for accessing webservices from different server (WS URL) etc. These URLs are different for different environments (Dev, QA, Pre-Prod, Prod).

What is the best way to handle these configurations? Is it via creating different config folders for different run modes?

Please suggest and it would be helpful if you can give me a link that explains how to create configurations (custom configurations) for different run modes.

Thanks,

このトピックへの返信は締め切られました。
ベストアンサー gopalKa

Yes, the best way to handle configurations for the same class, same project but in different environments is via run modes. Please refer to http://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/configuring-osgi.html#OSGi%20Configuration%20in%20the%20Repository .

7 の返信

gopalKaAdobe Employee回答
Adobe Employee
October 16, 2015

Yes, the best way to handle configurations for the same class, same project but in different environments is via run modes. Please refer to http://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/configuring-osgi.html#OSGi%20Configuration%20in%20the%20Repository .

ashtrick作成者
Level 3
October 16, 2015

Hi Kalyanar,

Thanks for the reply. That was very informative. 

Quick one, in AEM 6 where can I see the PID for my bundle/service?

Thanks,

-A

Adobe Employee
October 16, 2015

In configuration tab in system console, you will see the pid for each configuration. When you click open the configuration model, you will see something like this.

     
Persistent Identity (PID)com.adobe.acs.commons.wcm.impl.ComponentHelperImpl
ashtrick作成者
Level 3
October 16, 2015

Hi Kalyanar,

I have created a config folder in my project with a sling:OsgiConfig node for one of my service (com.test.impl.DistanceServiceImpl) and added properties to the node. I'm able to read the value in the bundle and all works fine !

 Now, how do I change the value of one of this property? Go to CRXDE Lite and change it? I would like to change the value through Felix console as CRXDE Lite is disabled in Production.

Thanks,

-A

Adobe Employee
October 16, 2015

since you have the osgiconfig node, this can be safely in your git/svn. So always change the nodes in prod by installing a new config package which does this. This allows you better control.

ashtrick作成者
Level 3
October 16, 2015

Problem with that approach is, we have got application support/management guys who has access to production and does the support. And there are some values specific to production environment that shouldn't be accessible to developers. These values needs to be added to the production environment directly.

What I have done to overcome this issue is, added osgiConfig node (com.test.impl.DistanceServiceImpl.config) and stored the non-changable parameters here. Then in the class, added @Property values that needs to be configured through Felix console.

Please let me know if this is the right approach.

Thanks

Adobe Employee
October 16, 2015

Manual intervention to a production system could be risky and not many allow that. We can rather store these configs in svn but only giv access to these support guys. Nowadays, a simple script can be written to fetch the correct file and package it and install in prod. This helps versioning as well. Ofcourse, training the team on how to use svn and running scripts will help.