
SAP Commerce Cloud provides a lot of self-service features to configure, build and deploy a commerce solution. When you're first getting started it could seem like a lot to take in. In this article we'll take you through step-by-step how to use the self-service features to configure your application, followed by how to build and deploy to your development environment. After following the steps in this article you should be comfortable with adding in any additional customizations and deploying them to your environment of choice. Before going through this article we do recommend you review the Initial Setup and Storefront Validation section of the product documentation, which this article expands upon.
Before you even think of building and deploying a project, you should first take a moment to get acquainted with the Cloud Portal, which is the self-service tool for managing your SAP Commerce Cloud solution. To access Cloud Portal, you'll need to have an SAP User ID (S-user) and have been granted access by someone with a Customer System Admin role. If you're not sure who your Super Admin might be, you can navigate to https://me.sap.com/userscontacts/usermanagement, select "Important Contacts" and then look for someone with the "Super Administrator" role. They can then grant you access like in the following video:
Assuming you're either a super admin or someone has granted you a role you can go to https://portal.commerce.ondemand.com/. If you have trouble with your password see this page in the product documentation. Make sure you're also using a supported browser.
Once you're logged in, you should make sure you have some environments provisioned. You can do so by clicking on the "Environments" button in the top left of the Cloud Portal. You should have at least 1 development, 1 stage and 1 production environment (if you require more environments, they are available for purchase). If you do not see any environments provisioned then you will need to find your Super Admin to use the self-service environment provisioning in SAP for Me (please consult the onboarding documentation for a step-by-step guide for environment provisioning)
The next step is to connect your empty Git repository you will be using for maintaining the code which will be built and deployed on SAP Commerce Cloud. Each subscription for SAP Commerce Cloud comes with the ability to connect to a single Git-based repository. The git repository needs to be on a public accessible server(not behind a firewall in a corporate environment). Access through SSH and HTTPS methods are both possible. The following video shows how to connect to a Git repository:
Before you even think of building and deploying a project, you should first take a moment to get acquainted with the Cloud Portal, which is the self-service tool for managing your SAP Commerce Cloud solution. To access Cloud Portal, you'll need to have an SAP User ID (S-user) and have been granted access by someone with a Customer System Admin role. If you're not sure who your Super Admin might be, you can navigate to https://launchpad.support.sap.com/#/user/management, select "Important Contacts" and then look for someone with the "Super Administrator" role. They can then grant you access like in the following video:
Assuming you're either a super admin or someone has granted you a role you can go to https://portal.commerce.ondemand.com/. If you have trouble with your password see this page in the product documentation. Make sure you're also using a supported browser.
Once you're logged in, you should make sure you have some environments provisioned. You can do so by clicking on the "Environments" button in the top left of the Cloud Portal. You should have at least 1 development, 1 stage and 1 production environment (if you require more environments, they are available for purchase). If you do not see any environments provisioned then you will need to find your Super Admin to use the self-service environment provisioning in SAP for Me (please consult the onboarding documentation for a step-by-step guide for environment provisioning)
The next step is to connect your empty Git repository you will be using for maintaining the code which will be built and deployed on SAP Commerce Cloud. Each subscription for SAP Commerce Cloud comes with the ability to connect to a single Git-based repository. The git repository needs to be on a public accessible server(not behind a firewall in a corporate environment). Access through SSH and HTTPS methods are both possible. The following video shows how to connect to a Git repository:
Now that your Git repository is connected, this section will help take your through the steps to populate the repository with code. There is an extensive section in the product documentation with various ways you can populate the repository, but if you're looking for a working template to get you started there are various code samples you can download to initially populate your repository. this section will cover how to get started with sample code which contains the structure for a working Spartacus-based storefront as well as a sample accelerator-based storefront.
Given your development team will most likely be developing and testing customizations locally, you should try to structure your repository to allow for building both locally and on your SAP Commerce Cloud environments. To do this, you'll need to keep in mind a few things:
Now that you're ready to get started locally, do the following:
Setting up Apache Ant
Run the following code that is dependent on your version to ensure your add-ons are loaded correctly:
ant addoninstall -Daddonnames="promotionenginesamplesaddon,smarteditaddon,textfieldconfiguratortemplateaddon,assistedservicestorefront,assistedservicepromotionaddon,customerticketingaddon,orderselfserviceaddon,adaptivesearchsamplesaddon,multicountrysampledataaddon,pcmbackofficesamplesaddon,personalizationaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"
ant addoninstall -Daddonnames="spartacussampledataaddon,commerceorgsamplesaddon,promotionenginesamplesaddon,smarteditaddon,textfieldconfiguratortemplateaddon,assistedservicestorefront,assistedservicepromotionaddon,customerticketingaddon,orderselfserviceaddon,adaptivesearchsamplesaddon,multicountrysampledataaddon,pcmbackofficesamplesaddon,hybrisanalyticsaddon,personalizationsearchsamplesaddon,personalizationaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"
ant addoninstall -Daddonnames="acceleratorwebservicesaddon,cmsoccaddon" -DaddonStorefront.ycommercewebservices="ycommercewebservices"
Performing the Build Procedure
Starting the Application Server and Deploying the Application
Initializing SAP Commerce
(Optional) If you want to have a local Blob storage instance for testing out Cloud Hot Folders you can go into hybris/config/local.properties file and un-comment the lines with the following keys:
cluster.node.groups
azure.hotfolder.storage.container.hotfolder
azure.hotfolder.storage.account.connection-string
If you accidentally uncomment these without setting up a local Blob storage your solution will still start, but you'll just see a lot of errors in your logs like "Connection refused (Connection refused): 127.0.0.1:10000"
12. You should now have your SAP Commerce solution running locally
13. Once your SAP Commerce Cloud solution is running locally (e.g. you can get to localhost:9001/hac) it's now time to get your Spartacus storefront built and running locally. To do this navigate to the js-storefront/spartacusstore
14. Execute the following command, which will build and run your storefront:
yarn build
yarn start
15. You should now have local instances running of SAP Commerce and the Spartacus storefront. To confirm the Spartacus storefront is working please navigate to http://localhost:4200
The Build Manifests enable you to configure your SAP Commerce Cloud solution to your exact specifications. You can define the build process using a manifest.json file, which is stored in your code repository. A sample manifest.json file has been included as part of the sample code we provided above. For this step you should review the manifest file to ensure you understand what each of the components are for and how the sample is configured. It is recommended that you minimize the changes in the beginning to ensure it works first with the Cloud Automation tooling. Some changes you likely would make in the future include
At this point you can now build locally, so you should commit and push your code to your git repository.
Before you build and deploy your solution you should take a moment to familiarize yourself with the various security configurations in Cloud Portal and ideally actually start configuring them to meet your business needs.
For more, watch the following video:
https://microlearning.opensap.com/media/1_ugnfs2pj
IP Filter Sets
By default, for each of your environments the endpoints are set to "Deny All" access. You can leverage IP Filter sets to determine which IPs should have access to each of your endpoints. The IPs will likely be different for each endpoint. Some recommendations:
SSL Certificates
Although SAP Commerce Cloud provides default SSL certificates for each of its endpoints, it is recommended that you look into using your own. If you already have SSL certificates you should take a moment to add them now and update your endpoint to point to the new certificate. This way you're testing right from the start, with your certificate.
Trusted Certificates / Host Alias
If you're going to be working with external services that require special certificates you can take this opportunity to load the certificates and set up the host alias sets. Given our example doesn't have any third party integrations this configuration is more optional for the moment.
Security Files
You can use the "Security Files" page in Cloud Portal to safely upload certificates, passwords, salts, tokens, and other security files to your subscription. You can then attach them to your environment so they will be picked up as part of the deployment.
Sensitive Properties
Although the sample code we provided contains environment specific "local.properties" files, there is often the case where you have certain properties that are very sensitive and you don't want to check in to your source control (e.g. passwords). You won't need this for this initial deployment, but it is good to get acquainted with the process for future deployments. One option is to use static files for your sensitive data. The other option is to define the properties as part of each environment's service configuration. The downside for this option is that anyone with customer sys admin role in Cloud Portal will be able to see these properties.
At this point you've confirmed your code is working locally, it's checked into your Git repository, you've configured your endpoints and managed your security settings. The next step is to build the code. The steps are outlined on this page of the product documentation. If for some reason your build fails you can see the build log, fix any issues and retry the build.
Once your build is successful you should first try deploying it to your development environment. Given it's your first deployment you should set it to "initialize database".
Once the deployment is complete you can open up the JS Storefront endpoint's URL and you should see the Project Spartacus storefront.
If you missed any of the build/deploy steps above, you can also watch the following video, which provides a walkthrough of the process:
Dynatrace
Each environment comes with an instance of Dynatrace Application Performance Monitoring. You should take a few moments to familiarize yourself with Dynatrace, as it is a very useful tool for monitoring your application as well as troubleshooting when issues arise. In the video below we show how to access Dynatrace:
https://microlearning.opensap.com/media/1_5i0xt6zz
Centralized Logging
Each SAP Commerce Cloud environment comes with its own logging endpoint. You should take this opportunity to setup your logging solution as it can also be very helpful for troubleshooting future issues.
In the sample code we've also included the configurations for an accelerator-based storefront, which you can access by clicking on the Storefront endpoint's URL. If you do not want to have an accelerator storefront:
See the following video which covers more about managing endpoints:
You should now have a running application in your development environment. At this point the possibilities are endless, If you're looking for more expert recommendations feel free to look at all the CRM and CX Blogs by SAP articles we have for SAP Commerce Cloud, as well as the best practices outlined in the product documentation.
Disclaimer: Original version of this article was published in SAP CX Works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |