Create a workspace from a deployed application

Support personnel who need to troubleshoot issues can create a workspace by copying a deployed application.

Note: This option is intended for support purposes only, and is not intended as a way to set up new developers on a project. Code and configuration should be maintained in source control, and developers should create their workspaces from these files rather than by copying a deployed application.

To create a workspace from a deployed application, enter the following command:

npx @oracle-cx-commerce/cli-init create-workspace <workspace-dir> --deployId <deploymentId> --appServerAdmin <admin-server-URL> --appKey

where <deploymentId> is the deployment ID of the deployed application, <admin-server-URL> is the URL of your Commerce administration interface, and <workspace-dir> is the absolute or relative path to the top-level directory of the workspace. This directory must currently not exist or else be empty. You can find the deployment ID of the application by using the deploy-status command, as described in Monitor deployed applications.

For example:

npx @oracle-cx-commerce/cli-init create-workspace my-workspace –-deployId 200004 –-appServerAdmin https://myhost-admin.oc-test.com --appKey

You will be prompted to specify an application key for downloading the deployed application. After you enter the application key, Commerce creates a new local workspace named my-workspace on your workstation by copying the specified workspace from the server.

As an alternative, you can specify the deployed application by indicating the environment it is running in and whether to use the live or preview version. For example:

npx @oracle-cx-commerce/cli-init create-workspace my-workspace –-appName my-storefront –-appServerAdmin https://myhost-admin.oc-test.com –-live --appKey