on 2019 Mar 05 6:26 PM
By default, installing (and initializing) for instance the "b2c_b2b_acc_oms" recipe results in all data stored in the embedded database (the installer creates a simple local.properties).
It would be great if we could install/intialize directly into our final database system.
I tried to figure out how to achieve that by "overriding" that config/local.properties between install.sh -r <recipe> and install.sh -r <recipe> initialize with my own configuration.
I would say that this approach worked in 1808, at least for installing the "b2c_acc" recipe.
Right now I am trying that on 1811.1 and every time that I run install.sh -r b2c_b2b_acc_oms initialize it replaces the target config/local.properties with the one from the recipe.
Is that a bug or so? Otherwise, is there a known way to get to first install, then customise properties and then initialize in one go?
Request clarification before answering.
The default behaviour of installing hybris using a recipe (i.e. using installer/install.sh or installer/install.bat) is that it replaces the content of local.properties and localextensions.xml with the configurations from build.gradle file of the respective recipe. This process also creates a backup of local.properties and localextensions.xml into hybris/config/backup folder before overwriting them.
Once we have executed the command install.sh -r <recipe>, we need not initialize it using install.sh -r <recipe> initialize. We can update local.properties with database connection properties and initialize the database by executing ant initialize from hybris/bin/platform -OR- by starting hybris and then clicking Initialize button at https://localhost:9002/platform/init (or hAC > Platform > Initialization).
If you want local.properties to be updated with database connection properties automatically on executing install.sh -r <recipe> or install.sh -r <recipe> initialize, you can add the database connection properties in the localProperties{} section of build.gradle file of the <recipe> e.g.
localProperties {
property 'googleApiKey', ''
property 'multicountrysampledataaddon.import.active', 'false'
property 'apiregistryservices.events.exporting', 'false'
property 'db.driver','oracle.jdbc.driver.OracleDriver'
property 'db.url','jdbc:oracle:thin:@localhost:1521:XE'
property 'db.username','CX1811'
property 'db.password','CX1811'
property 'db.pool.maxActive','90'
property 'db.pool.maxIdle','90'
}
However, I do not recommend to change it directly in the build.gradle file of a recipe (e.g. b2c_acc); rather, you should create a copy of the recipe folder (e.g. b2c_acc) with a new name, say b2c_acc_oracle and make changes in the build.gradle file of b2c_acc_oracle so that you can use b2c_acc_oracle for installing hybris with Oracle connection properties and b2c_acc for installing hybris with default database (HSQLDB).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arvind. Thank you for your advise.
I found that the issue happens with b2c_b2b_acc_oms but not with b2c_acc (both on 1811.1). Then comparing these two recipes I notice that there are indeed differences that lead to confirm that the b2c_b2b_acc_oms recipe replaces local.properties on initialize while b2c_acc does not.
As a solution, I have found installer/README.md mentions that creating a installer/customconfig/custom.properties files does the trick.
Regarding install.sh -r b2c_b2b_acc_oms initialize, it seems that it not only initialises the tenant as ant initialize does. It also "builds" the yb2bacceleratorstorefront into the bin/custom directory plus applies addons to both yb2bacceleratorstorefront and yacceleratorstorefront. Thus I believe that it would not be enough just running ant initialize. I would say it requires also ant clean all before that, but running that command results in another error (which I will probably report in a separate thread).
That said, the "easiest" solution to this question would be creating installer/customconfig/custom.properties as indicated above.
Than you! Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.