LogoLogo
  • Digital River commercetools 1.0
    • System Requirements
    • Upgrade path
  • Understand the Digital River commercetools integration
    • Understand the integration workflow
    • Features
    • What’s new for Digital River's commercetools integration 1.0
  • Install and configure the Digital River commercetools integration
  • Create integration access keys
  • Configure the integration
    • Configure Digital River in Dashboard
    • Configure commercetools
    • Map shared data used in the integration
  • Deploy the integration
    • Understand integration environment variables
  • Use the commercetools Merchant Center custom application
    • Install and deploy the Merchant Center custom application
    • Configure the Merchant Center custom application
    • Integrate with a store for payments
    • Configure shipping methods
    • Enable customer management options
    • Understand integration logs
    • Merchant Center custom application user guide
      • Authorize a payment
      • Cancel an authorization
      • Capture a payment
      • Use the demo store custom application
      • Refund a payment
  • Support
Powered by GitBook
On this page
  • Deploy for Google Cloud
  • Create a secrets file
  • Deploy to CloudRun
  • Subscription setup
  • Use health endpoints

Deploy the integration

Learn to deploy the Digital River commercetools integration.

PreviousMap shared data used in the integrationNextUnderstand integration environment variables

Last updated 2 years ago

The Digital River commercetools integration is distributed as a container image and can be deployed to many providers. Use the instructions provided in this topic to deploy the connector for Google Cloud.

Deploy for Google Cloud

To deploy the integration for Google Cloud, you must have gcloud installed and configured so that it can be referenced in the deployment. It is also assumed that you have a Google Cloud project as well as access to the appropriate APIs.

Refer to the and contact your Digital River representative to obtain the plugin container image used for deployment as well as installation instructions. If you do not have a Digital River representative, contact commercetools-Integration@digitalriver.com.

Create a secrets file

Perform this step only once unless values change in the future.

  1. Create an application.yml file with the following values:

    commercetools:
      client-secret: <your commercetools API key client id>
      client-id: <your commercetools API key client secret>
    
    connector:
      secret:
        decryption-key: |
          -----BEGIN RSA PRIVATE KEY-----
          <your private key for decrypting secrets>
          -----END RSA PRIVATE KEY-----
  2. Create a Google Cloud secret to store it. This only needs to be done once, even when updating.

  3. Replace <secret name> with the name you will use for the secret. For example, gcloud secrets create <secret name> --replication-policy="automatic"

  4. Set the secret content. For example: gcloud secrets versions add <secret name> --data-file="path/to/application.yml"

Deploy to CloudRun

gcloud beta run deploy <instance name> \
  --region <gcloud region> \
  --image <path to container image ** TODO ** > \
  --no-cpu-throttling \
  --platform managed \
  --allow-unauthenticated \
  --project <project name> \
  --timeout=20m \
  --set-env-vars 'COMMERCETOOLS_PROJECT_KEY=<your commercetools project key>' \
  --set-env-vars "COMMERCETOOLS_AUTH_URL=$<commercetools auth URL>" \
  --set-env-vars "COMMERCETOOLS_API_URL=<commercetools API URL>" \
  --set-env-vars "QUARKUS_OIDC_AUTH_SERVER_URL=<auth server for your commercetools project>" \
  --set-env-vars "CONNECTOR_BASE_URL=<base URL where the connector is reachable>" \
  --set-env-vars "DIGITAL_RIVER_SHIPPING_CALLOUT_ENDPOINT=<connector base URL>/api/v1/shipping-methods/quote" \
  --set-secrets=/secrets/application.yaml=<secret name>:latest

Note: CPU throttling needs to be disabled with Cloud Run to allow for the running of manual synchronization of products.

Subscription setup

For real-time product synchronization, you must have a "topic" that will receive messages from commercetools ProductPublish and ProductUnpublish. The topic needs to be configured to forward messages along to the Publish endpoint in the integration. Use the following steps to do this:

  1. Create a PubSub push subscription called commercetools_product_publish. The Push endpoint should be {base_url}/api/v1/products/publish where base_url is the location where the integration can be found. Use the following settings guidelines:

    1. The Acknowledgment deadline should be 60 seconds.

    2. The name can be anything you choose. A meaningful name is recommended.

Use health endpoints

The integration image has 3 "health" endpoints you can use for startup and monitoring "status" purposes. These are:

  • /q/health/live

  • /q/health/ready

  • /q/health/started

Refer to the Digital River API documentation for more information on how to use these endpoints.

For this step, replace <instance name> with the name that you want for your Cloud Run instance. Other values should be substituted as described in .

Create a PubSub topic called commercetools_product_publish. The name can be anything of your choosing but must match the one you used in the setup procedure described in .

Grant roles/pubsub.publisher to subscriptions@commercetools-platform.iam.gserviceaccount.com on this topic. See the for details.

You should make sure the /api/vi/products/publish endpoint is secure. See for details on how to do this for CloudRun.

Google Cloud documentation
Understand integration environment variables
Install and configure the Digital River commercetools integration
commercetools documentation
https://cloud.google.com/run/docs/triggering/pubsub-push