Search code examples
sap-commerce-cloud

New developer process for Hybris


I am working on learning Hybris. I have successfully install hybris, there are lots and lots of blogs out there that talk about getting the core hybris install with your own custom moduleds to make changes to, such as this one:

http://javainsimpleway.com/hybris-b2b-installation/

In the blog above the gentleman creates a mystore. The question I have is this: Once you have this all setup, you have made changes to the mystore modules and you want get those changes onto a new developers machine (or productions machine), who do you do it?

What I have tried, which does not work is this:

  1. zipped up the bin/custom/mystore, config/local.properties, and localextensions.xml
  2. followed his steps 1 thru 4
  3. unzipped the files on the new machine
  4. jumped down to step 12 where he does an ant clean all initialize

One difference between his process and mine is that I am adding some addon's. It is my impression that all those changes happen with custom/mystore, but to be safe between my steps 3 & 4 I have rerun the ant addoninstall for all four addon's.

The process I have documented, SmartEdit was not working and I found SAP's documentation about running ant npminstall because Hybris does not include npm-related 3rd party JavaScript libraries. This are blowing up when I go to run ant npminstall.

I really feel like I am trying to recreate the wheel here. I would imagine what I am trying to do is very common to any Hybris team, but I cannot find documentation on how to do it. Does anyone know of a blog out there that talks about how to migrate the source from one machine to another?


Solution

  • there are lots and lots of blogs out there that talk about getting the core hybris install with your own custom moduleds to make changes to

    Although they may be helpful, I would suggest you stick to official Hybris documentation (e.g. https://help.sap.com/viewer/4c33bf189ab9409e84e589295c36d96e/1905/en-US/8acc8a5a86691014a20781b3f738213e.html) which is quite rich.

    Once you have this all setup, you have made changes to the mystore modules and you want get those changes onto a new developers machine (or productions machine), who do you do it?

    For production deployment, please go through https://wiki.hybris.com/display/hybrisALF/Ant+Production+for+Continuous+Integration

    However, for simply copying the things from one machine to another machine, whatever artefacts you have already copied to the target machine (after you have installed Hybris on the target machine), are correct. If you are working in a team, you typically set up an SCM (e.g. git, SVN etc.) code repository and then it becomes easier.

    It is my impression that all those changes happen with custom/mystore

    This is a wrong impression. When you run addon install it creates/updates the project.properties file in the addon; not in your custom/mystore. So, if the addon is part of the code repository (which is typically not the case unless it is a custom addon), anyone pulling your code on their machine will automatically get the addon project.properties and therefore they will not require to run addon install on their machines; otherwise, they need to run addon install on their machines. A workaround is to copy the content of the addon project.properties to the local.properties (and thus getting the changes to the target machine when the local.properties is copied to the target machine).

    This are blowing up when I go to run ant npminstall.

    Make sure to run ant npminstall as an admin user. Please check https://answers.sap.com/questions/12771768/smart-edit-unable-to-find-local-grunt.html for another option.