Skip to content

Latest commit

 

History

History
116 lines (65 loc) · 5.12 KB

deploying-content-with-cf-task-execution-98b1bf5.md

File metadata and controls

116 lines (65 loc) · 5.12 KB

Deploying Content with CF Task Execution

This approach for content deployment relies on an intermediate Cloud Foundry application that communicates with the content backend. This application includes both the content and the content specific deployer.

The content specific deployer is defined as an application dependency during design time. It is then included in the MTA archive. During deployment, it serves as a client for the actual content deployment to the content backend.

Note:

This approach is a natural successor to Deploying Content with Simulated App Execution. When possible, it is recommended to use the current approach instead of the legacy one. Normally, there is only one dedicated content deployer for each content type that handles both approaches.

Supported content types that currently allow deployment with CF Task execution:

The following diagram illustrates the steps and BTP components involved in the process of content deployment with CF task execution:

The following steps describe the process of content deployment with CF Task execution:

  1. A developer/operator runs MTA deployment

  2. SAP Cloud Deployment service creates or reuses a service instance provided by an SAP application

  3. During this step:

    1. SAP Cloud Deployment service creates a Cloud Foundry application that serves as a content application

    2. SAP Cloud Deployment service binds the service instance to the content application

    3. SAP Cloud Deployment service uploads the combination of content and content deployer as application bits

  4. SAP Cloud Deployment service runs CF tasks, including the one responsible for actual content deployment

  5. The dedicated CF task of the content application triggers the content deployer, which in turn performs the actual content deployment. During this step:

    1. The CF task reads content details from the bound service instance and identifies the content endpoint and the required authentication

    2. The CF task executes the content deployment to the content endpoint

  6. The CF task completed successfully

  7. The MTA deployment completes and SAP Cloud Deployment service reports the status to the developer/operator

The Content Deployer and Service Instance follow the same rules as the ones from Deploying Content with Simulated App Execution.

Tasks are native to Cloud Foundry and are valuable in various scenarios, which demand one-off jobs. For more information, see Tasks.

CF tasks, dedicated for content deployment, are predefined from the SAP Cloud Deployment service and must not be changed by the end customer. They are represented by the module level parameter tasks.

Below you can find the modeling for supporting the content deployment scenario for MTA module type com.sap.xs.hdi:

Sample Code:

_schema-version: "3.1" 
ID: my.app 
version: "1.1" 
- name: module-db 
    type: com.sap.xs.hdi 
    parameters: 
      buildpack: nodejs_buildpack //Predefined parameter 
      no-route: true  // Predefined parameter - skipping route mapping to the app 
      no-start: true // Predefined parameter - skipping start of the app because only tasks are important in the scenario 
      memory: 256M // Predefined parameter 
      tasks: // Predefined parameter – all details below define the CF tasks 
        - name: deploy 
          memory: 256M 
          command: npm start // Shell script that will be used for triggering actual content deployment 
    properties: 
      EXIT: 1 // Predefined property – instructs the HDI deployer to exit when done 
    requires: 
      - name: hdi-service 
 
resources: 
  - name: hdi-service // Provides content endpoint for the actual content deployment. Content endpoint could be different based on the used database 
    type: com.sap.xs.hdi-container