The original link

The SAP Commerce Cloud provides a number of self-service capabilities to configure, build, and deploy business solutions. When you first start using it, it may seem like a lot to know. In this article, we take you step-by-step through how to configure your application using self-service capabilities, and then how to build and deploy it into your development environment. After following the steps in this article, you should be able to easily add any other customizations and deploy them to the environment of your choice. Before reading this article, we recommend that you read our introduction to the SAP Commerce Cloud article, which covers some of the concepts/terminology we will cover in this article. You may also want to look at the initial setup and storefront validation sections of the product documentation, which this article expands on.

Initial Access to SAP Cloud Portal

Before you consider building and deploying a project, you should take a moment to familiarize yourself with Cloud Portal, a self-service tool for managing SAP Commerce Cloud solutions. To access Cloud Portal, you need to have an SAP user ID (User S) and have been granted access by someone in the role of a customer system administrator. If you are not sure who is your super administrator, you can navigate to https://launchpad.support.sap… , select “Important Contacts” and then look for the “People” role with “Super Administrator” status. They can then grant you access.

Assumes that you are the super administrator or someone grants you the role, you can visit https://portal.commerce.ondem… . If you have a problem with your password, please refer to this page in the product documentation. Make sure you also use a supported browser.

Once logged in, you should make sure that some environment is configured. You can do this by clicking the Environment button in the upper left corner of the cloud portal. You should have at least 1 development, 1 phase, and 1 production environment (purchase if you need more). If you don’t see any configured environments, you’ll need to find your super administrator to use the self-service environment configuration in SAP Customer Experience Cockpit.

Connect an Empty Git Repository

The next step is to connect to the empty Git repository that you will use to maintain the code that will be built and deployed on the SAP Commerce Cloud. Each subscription to the SAP Commerce Cloud is able to connect to a Git-based repository. Git repositories need to be on publicly accessible servers (not behind firewalls in a corporate environment). It can be accessed via SSH and HTTPS methods.

Set Up Your Git Repository

Now that your Git repository is connected, this section walks you through the steps to populate it with code. There is an extensive section of the product documentation where you can populate the repository in various ways, but if you are looking for a working template to help you get started, you can download various code samples to initially populate the repository. This section shows you how to get started with the sample code that contains the structure of the Spartacus-based working storefront and the accelerator-based sample storefront.

Get it Working Locally

Given that your development team will most likely develop and test customizations locally, you should try to build your repository to allow builds both locally and in your SAP Commerce Cloud environment. To do this, you need to keep the following in mind:

Make sure that you use the gitignore file to upload only items that are not automatically added as part of the SAP Commerce Cloud build automation process to your repository.

For example, you should not add the SAP Commerce “bin” folder, because the relevant extensions that you declare in the manifest file (see below) will be added automatically as part of the build.

The sample code assumes that you want to develop locally using the Cloud Hot Folders. If you are using SAP Commerce Core Version 2005, the SAP-CCV2-HotFolder module is included. If you are using Commerce Core 1905, you will need to get the Extension from the Cloud Extension Pack.

Even if you are not using the optional cloud extension package, you will need to download this artifact because you will need the SAP-CCV2-HotFolder module that comes with it. If you’re using Cloud Extension Packs, you’ll need all the code. To download at launchpad.support.sap.com search “CX Comm” and select the suitable for your version of the “Ext Pack”. For more information, see Testing Cloud-Hot Folders in a Local Environment in the product documentation. If you are using Commerce Core 6.7-1811, see this SAP Note.

You will need a copy of the latest patch version of the SAP Commerce core that you will be using. See this page to learn how to download.

Now that you are ready to start locally, do the following:

  • Clone the empty Git repository in which you will store your code
  • (Optional) If you want to start your code review process right from the start, you may need to create a Development and Functional branch where you will store your code
  • Select a branch using our open source sample repository and download the ZIP for this code sample. Note: The code sample repository contains multiple branches, each covering a different use case (data center, Spartacus, Vanilla). You can choose a different branch, but in this example, we are using the Spartacus branch.

  • Extract the sample code file to the location where you cloned your Git repository
  • Unzip the copy of the SAP Commerce core at another location
  • Move the following folders from the decompressed SAP Commerce core directory to core-customize/hybris/bin: hybris/bin/modules and hybris/bin/platform in step #4
  • (Optional) If you are using the Cloud Extension Pack, Then unpack the contents of “Hybris /bin/modules/” from Step 4 and copy it to the directory “Hybris /bin/modules-cep” to complete the following part of the installation steps in the product documentation: Set up Apache Ant
  • Run the following code to ensure that your add-on is loaded correctly:

ant addoninstall -Daddonnames=”promotionenginesamplesaddon,smarteditaddon,textfieldconfiguratortemplateaddon,assistedservicestorefront,as sistedservicepromotionaddon,customerticketingaddon,orderselfserviceaddon,adaptivesearchsamplesaddon,multicountrysampleda taaddon,pcmbackofficesamplesaddon,personalizationaddon” -DaddonStorefront.yacceleratorstorefront=”yacceleratorstorefront”

  • Continue with the following sections of the installation steps in the product documentation:

(1) Execute the build process

(2) Start the application server and deploy the application

(3) Initialize SAP Commerce

  • Once your SAP Commerce Cloud solution is running locally (for example, you can access localhost:9001/ HAC), you can now build and run your Spartacus storefront locally. To this end, please navigate to the js – storefront/spartacusstore

Execute the following commands, which will build and run your storefront:

yarn build


yarn start

You should now have local instances running SAP Commerce and Spartacus stores. To confirm that the Spartacus storefront is running, navigate to http://localhost:4200

Review and Configure Your Build Manifest

Build Manifests enable you to configure the SAP Commerce Cloud solution according to your specific specifications. You can define the build process using the MANIFEST.JSON file, which is stored in your code repository. The sample MANIFEST.JSON file is included in the sample code we provided above. For this step, you should review the manifest file to make sure you understand what each component does and how the examples are configured. It is recommended that you minimize changes at the beginning to ensure that it works with the Cloud Automation tool first. Some of the changes you may make in the future include:

  • CommerceSuiteversion – The version of SAP Commerce Core that you are using
  • UseCloudExtensionPack – If you want to enable CloudExtensionPack
  • StoreFrontAddons – If you have any other additional extensions enabled in the LocalExtensions.xml file, make sure they are included in your list
  • Aspects – Define any properties and web applications for any predefined Aspects
  • Tests – If you have any tests in your extension that you want to run as part of the Cloud Automation build, you should include them here

Commit to Your Git Repository

At this point you can now build locally, so you should commit the code and push it to your Git repository.

The Initial Build

At this point, you have confirmed that your code is running locally, checked into your Git repository, and you have configured the endpoint and managed your security Settings. The next step is to build the code. This page in the product documentation Outlines these steps. If your build fails for some reason, you can look at the build log, fix any problems, and retry the build.

The Initial Deploy

Once your build is successful, you should first try to deploy it into your development environment. Since this is your first deployment, you should set it to “Initialize the database.”

After the deployment is complete, you can open the URL of the JS Storefront endpoint, and you should see the Project Spartacus Storefront.

More of Jerry’s original articles can be found on “Wang Zixi “: