Oracle CX Commerce is a robust cloud service for building store fronts, and FlexDeploy includes multiple features to automate the deployment of CX Commerce code and configurations. Oracle CX Commerce Server-Side Extension provides an environment to add additional valuable features on the server side. (See Working with Commerce Cloud Server-Side Extensions.) OCCS server-side extension is a Node.js application and uses Express to define REST endpoints or routes.
(See our blog post, Oracle CX Commerce Deployment Automation with FlexDeploy, for additional information on FlexDeploy’s OCC support.)
See the code below for sample extension named customWebhookTargets. Developers can create such extensions using an IDE on their workstation and commit it to a source code repository.
Deploying server side extensions to Oracle CX Commerce requires use of REST API. Admin UI does not provide option to view or upload such extensions. You also need to perform authentication first as well using App Key.
FlexDeploy’s CX Commerce Cloud Plugin
FlexDeploy provides out-of-the-box options to upload such extensions via the CX Commerce Cloud Plugin. This plugin also provides an operation to delete existing extensions, which can be useful in some situations.
Let’s review the details.
Define OCC Environments
First we can define various OCC environments as accounts in FlexDeploy. FlexDeploy’s plugin will use these details to connect to cloud environments.
Note that each cloud environment will have a different URL and App Key. App Key is encrypted in FlexDeploy or it can be retrieved from external credential store like CyberArk, Hashicorp Vault, or Azure Key Vault.
Create Build and Deploy Workflows
FlexDeploy’s CX Commerce plugin can be used in a workflow to perform build and deploy operations. Build workflow contains steps to extract code from source code repository and then perform build, which is just a zip operation. Build artifacts are then used during deploy execution.
See an example of deploy workflow below. Note that you are not writing any script code here, just using the drag and drop editor with out-of-the-box operations to create reusable workflows.
We need a simplistic topology to define various cloud environments in FlexDeploy to reference the cloud account created previously. There is no need to create new Endpoint (SSH) as all invocations are done remotely from FlexDeploy (i.e., using LOCALHOST Endpoint).
Create a Project to Tie it all Together
FlexDeploy project (one per each server side extension) can now bring everything together for DevOps automation. The project references build and deploy workflows, a Git repository, and a folder for source code. We can either automatically (scheduled poll, Git webhook, etc.) or manually trigger build and deploy execution.
We recommend using the Git webhook feature to automatically build and deploy your extensions as soon as code is committed to the Git repository. Here is a view into build and deploy execution activity. Note that you are able to clearly indicate which specific version is deployed to which environment.
See FlexDeploy Oracle CX Commerce Plugin Guide for more details on this plugin.