Imagine you have a need to execute system initialization without using the HAC console. Such an option is possible on the SAP Commerce side with proper ANT target calls dedicated to initialization and update, but both by default are executed with default options enabled.

Take a look at the below screens. They present default configuration when you want to execute system initialization or update and can be triggered with:

// initialization
ant initialize

// update
ant updatesystem

Initialization

Update


Now the question is:

How can we execute the Update process with only selected options:

  • Update running system
  • Localize types
  • Project data of c4tunebackoffice module

To do this we simply selected desired options on the HAC Update page and click Dump configuration button. This action should result in getting below JSON:

{
  "init": "Go",
  "initmethod": "update",
  "localizetypes": "true",
  "c4tunebackoffice_sample": "true",
  "basecommerce_create geocoding cron job": [
    "no"
  ],
  "patch_validation": [
    "ba04041624e635f97ebd48c2d9fbdf26"
  ],
  "filteredPatches": "true"
}

Now we simply save this content as JSON file, let’s assume c4tuneupdate.json under HYBRIS_CONFIG path and execute ant target:

ant updatesystem -DconfigFile=./../../config/c4tuneupdate.json

The logs speak for themselves:

ant updatesystem -DconfigFile=./../../config/c4tuneupdate.json
Buildfile: a:\C4TUNE\hybris\bin\platform\build.xml
...
  [echo] Using configuration from ./../../config/c4tuneupdate.json
  ...
  [java] INFO  [main] [Initialization] ###############################################################
  [java] INFO  [main] [Initialization] Updating system …
  [java] INFO  [main] [Initialization] ###############################################################
  ...
  [java] INFO  [main] [Initialization] ### Starting type system update
  ...
  [java] INFO  [main] [Initialization] Localizing types …
  ...
  [java] INFO  [main] [Initialization] ################ Creating project data
  [java] INFO  [main] [Initialization] Creating project data for c4tunebackoffice …
  ...
  [java] INFO  [main] [Initialization] ###############################################################
  [java] INFO  [main] [Initialization] FINISHED. The updating took: 0d 00h:02m:00s:017ms
  [java] INFO  [main] [Initialization] ###############################################################

Now some details about JSON configuration itself focusing on important properties. So …

"initmethod": "update" 

… defines that we will execute Update, not Initialization and enables also Update running system option …

"essential": "true"

… enables Create essential data option …

"localizetypes": "true"

… enables Localize types option …

"createProjectData": "true"

… enables Init/Update All option …

"[extension name]_sample": "true"

… enables project data option for [extension name] extension.

If you want to automate the deployment process of SAP Commerce either on your Linux or using Jenkins above will help you with adjusting the process so that it includes also proper system actualizations.


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *