Search code examples
antsap-commerce-cloud

How to change *.properties after ant production


I have 2 .properties files for my project on hybris . First one is used for CI process and as a result a got 4 zip files with my already built platform(after ant production). On my prod instance i need to switch to another properties because there are all my connections to extended services such as mysql solr.. etc How i can do that without running all ANT steps.

. ./setantenv.sh && sync && ant config -Denv=my_new_properties

then ./hybrisserver.sh start doesn't work. There is no information on wiki https://cxwiki.sap.com/display/release5/ant+production+improvements


Solution

  • Check if Updating Configuration Settings at Runtime will be useful for you. You will need to use the FileBasedConfigLoader class and the runtime.config.file.path property.

    Other best practices include using system variables for secure settings like DB URL. See "Using Environment Variables instead of Files for Secure Settings" section in Configuring the Behavior of SAP Commerce.

    Another option you can look at is to have different config folders for different environments (e.g. config-dev, config-prd), and pass it to ant. e..g -Denv=config--dev