Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Deploying the SDKs to another server

Updated on November 8, 2022

After creating distribution build which contains component metadata and static content, the build package can be deployed to another web server. The distribution build is served from a specific location in a web-server directory structure. This article describes the configurations and procedures for deploying the Constellation SDKs to such a server. This article assumes that you have an instance of the SDKs set up already, so it will not delve into installing and configuring the necessary files. For information about installing the SDK files, see Installing the Constellation SDKs.

Our setup

We use the following setup in the procedure. This is only an illustration of the procedure, replace the file paths and URIs based on your setup. 

  • Pega Infinity set up at the demo server https://sdk-dev.pegatsdemo.com.
  • MediaCo sample application installed at https://sdk-dev.pegatsdemo.com/pwebed/app/mediaco.
  • Constellation SDK files hosted in the Tomcat web server. Tomcat ROOT is at /var/lib/tomcat/webapps
    • Path for the Angular SDK: /var/lib/tomcat/webapps/ROOT/SDK-A.
    • Path for the React SDK: /var/lib/tomcat/webapps/ROOT/SDK-R
    • Path for the Web Components SDK: /var/lib/tomcat/webapps/ROOT/SDK-WC.
Tip: Since we will be copying files into the Tomcat server, we create a symbolic link (symlink) from ~/webapps to /var/lib/tomcat/webapps. This is optional, you can opt to use the full path to the Tomcat server webapps directory if you do not want to use a symlink.

Procedure

The following procedure outlines the procedure to deploy a distribution build of Constellation SDKs to a production server. Where applicable, a step is linked to a detailed section for your reference. We demonstrate the procedure using the React SDK as an example, the detailed sections show the corresponding file names, paths, and folders for all the Constellation SDKs.

  1. Open a terminal window at the SDK folder. For example: ~SDK/react-sdk.
  2. Pull the latest version of the SDK from the GitHub repository.
    git pull
  3. Perform a fresh installation of the npm components. 
    npm run build:prod:ci
    You must do a fresh installation every time there is an update or modification in the npm dependency.
  4. Edit the sdk-config.json file to update the server URLs and optionally, the mashup password.
  5. Edit the index.html file to update the base tag.
  6. Edit the app configuration file to update the base reference value. This step is required for the Angular and React SDKs only.
  7. Rebuild the SDK. This generates the code in the SDK's dist folder (the distribution build folder).
    npm run build:prod
    You can also do a development build (npm run build:dev) to troubleshoot any errors you might encounter before doing a production build.
  8. Copy the generated code from the /dist folder into the SDK's location in the Tomcat server. We use the symlink in this step, use the full path if you do not want to use a symlink. For example:
    cp -R dist/* ~webapps/ROOT/SDK-R
  9. Copy the authorization file from the SDK to the Tomcat "root" folder. For example:
    cp dist/auth.html ~webapps/ROOT 
    This completes deploying the SDK into the production server.
  10. Verify whether the deployment was successful by running the links for the SDK's Embedded and Portal modes. For example:
    https://sdk-dev.pegatsdemo.com/SDK-R/portal.html
    https://sdk-dev.pegatsdemo.com/SDK-R/embedded.html
    The SDK's Portal and Embedded modes should start. 


 

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us