关于sap:SAP-Commerce-Cloud-Build-Manifest-Components

74次阅读

共计 7983 个字符,预计需要花费 20 分钟才能阅读完成。

官网帮忙文档:
https://help.sap.com/viewer/1…

The components of the build manifest enable you to configure a number of build attributes by modifying various extensions, properties, aspects, and tests.

build manifest 组件容许咱们通过批改各种 extensions,properties,aspects,来定义一系列 build 属性。

定义利用版本

The application version defines the exact version of the SAP Commerce Cloud artifact to download. It is recommended to use the latest version of the application, but if necessary, you can define a patch version. The application version is a mandatory component of the manifest.

此处指定主动下载 SAP Commerce Cloud 的版本号:

“commerceSuiteVersion”: “2011”

Extension Packs

Extension packs allow you to identify more versioned software artifacts to combine with SAP Commerce Cloud during installation.

Extension pack 容许咱们定义更多具备版本号的软件 artifacts,随同 SAP Commerce Cloud 一起装置。

例子:

{
    "commerceSuiteVersion": "2011",
    "extensions": [
        "modeltacceleratorservices",
        "electronicsstore",
        "yacceleratorstorefront",
        "backoffice"
    ],

In the extended manifest.json file, the extension-packs section contains a list of named and versioned artifacts:

{
    "commerceSuiteVersion" : "2011",
    "extensionPacks" : [
    {
        "name" : "media-telco",
        "version" : "a.b.c.d"
    }
    ],
    "extensions": ["customerstorefront"]
}

Extension packs are downloaded during the build process.

Extension packs download extra software artifacts.

extension packs 会下载额定的软件 artifacts.

In the extension-packs section, define which artifacts should be downloaded. List all specific extensions required for the build in the extensions section.

Extensions

You can expand SAP Commerce Cloud functionality with extensions.

通过 Extensions, SAP Commerce Cloud 性能得以扩大。

Some of these extensions are bundled and distributed as part of a module.

局部 Extensions 以 module 的一部分被打包和公布。

An extension can contain business logic, type definitions, a web application, or a Backoffice Administration Cockpit configuration.

extension 能够蕴含业务逻辑,类型定义,web 利用,或者蕴含 Backoffice 管理工具的配置信息。

Extensions 的可能起源:

Extensions are drawn from the following potential sources:

  1. Your code or Git repository.
  2. SAP Commerce Cloud (as defined by the application version).
  3. MT Module, which provides the SAP internal extensions that were developed to run on SAP Commerce Cloud in the public cloud.
  4. Extensions packs.

The manifest is a list of requested extensions. The final list of enabled extensions can differ from the set defined in the manifest. To view all enabled extensions, refer to either the SAP Commerce Cloud Administration Console or SAP Commerce Cloud logs at startup.

留神,最终运行时启用的 Extensions 列表,可能和 manifest.json 里定义的不一样。以运行时在 HAC 或者 startup log 里看到的 Extensions 列表为准。

Extensions that are always enabled in all SAP Commerce Cloud deployments are handled automatically and hence aren’t included in the manifest. An example of an extension that is always enabled is azurecloud.

在所有 SAP Commerce Cloud 部署里都永远启用的 Extensions,比方 azurecloud,不须要列举在 manifest.json 里。

Addons

AddOns are a type of extension that allows you to add front-end files, such as JSP, HTML, CSS, JavaScript files, or images, from within your own AddOn. When you use AddOns, you do not need to modify the storefront front-end file directly.

Addon 是一种非凡的 Extensions,可能增加前端利用应用的文件,比方 JSP,HTML,CSS,JavaScript 文件等等。应用 Addons,不须要间接批改 Storefront 的规范实现。

The ant addoninstall command automatically installs storefront AddOns to SAP Commerce Cloud during the build process. If your code repository contains a storefront that is generated from a template with AddOns already installed, there is no need to configure it in the manifest.

ant addoninstall 命令,在 SAP Commerce Cloud build 过程中,主动装置 Storefront addon.

If your code repository contains a storefront that is generated from a template with AddOns already installed, there is no need to configure it in the manifest.

如果代码仓库蕴含了一个 Storefront,是基于一个 template 生成的,而该 template 对应的 addons 曾经装置了,此时不须要再将其配置到 manifest.json 里。

Aspect

Aspects contribute to containerization support by defining the roles of SAP Commerce Cloud instances in a Kubernetes cluster.

Aspects 的作用是,通过定义 SAP Commerce Cloud 实例在 Kubernetes 集群里运行时表演的角色,提供容器化反对。

You can enhance the overall performance of the cluster by independently enabling different roles and settings on individual nodes.

通过别离为不同的节点启用不同的角色和设置,能够进步集群整体的性能。

All aspects include properties and webapps.

所有的 aspect 都蕴含 properties 和 webapps.

The webapps identify the web applications that are available to the aspect, as well as the contextPath to use when accessing the web application.

webapps 属性标识了对该 aspect 可用的 web 利用,以及 contextPath,即拜访该 web 利用应该应用的门路。

构建流程主动配置下列五个 aspects:

  1. accstorefront: Configures the storefront
  2. backoffice: Configures Backoffice
  3. backgroundProcessing: Executes tasks in the background
  4. admin: Performs ant administration tasks, such as initialization and updatesystem
  5. api: Modifies webservices for increased security and to support different configurations. If there’s no webapps aspect in manifest.json, then only default webapps are included (mediaweb, hac and oauth2).
     "aspects": [
        {
            "name": "backoffice",
            "properties": [
                {
                    "key": "test.property.1",
                    "value": "test.property-1-value-prod-backoffice",
                    "persona": "production"
                },
                {
                    "key": "test.property.2",
                    "value": "test.property-2-value-backoffice"
                }
            ],
            "webapps": [
                {
                    "name": "hac",
                    "contextPath": "/hac"
                },
                {
                    "name": "mediaweb",
                    "contextPath": "/medias"
                },
                {
                    "name": "backoffice",
                    "contextPath": ""
                }
            ]
        },
        {
            "name": "accstorefront",
            "properties": [
                {
                    "key": "spring.session.enabled",
                    "value": "true"
                },
                {
                    "key": "spring.session.yacceleratorstorefront.save",
                    "value":"async"
                },
                {
                    "key": "spring.session.yacceleratorstorefront.cookie.name",
                    "value": "JSESSIONID"
                },
                {
                    "key": "spring.session.yacceleratorstorefront.cookie.path",
                    "value": "/"
                },
                {
                    "key":"storefrontContextRoot",
                    "value":""
                }
            ],
            "webapps": [
                {
                    "name": "mediaweb",
                    "contextPath": "/medias"
                },
                {
                    "name": "mycustomstorefront",
                    "contextPath": ""
                },
                {
                    "name": "acceleratorservices",
                    "contextPath": "/acceleratorservices"
                }
            ]
        },
        {
            "name": "backgroundProcessing",
            "properties": [],
            "webapps": [
                {
                    "name": "hac",
                    "contextPath": ""
                },
                {
                    "name": "mediaweb",
                    "contextPath": "/medias"
                } 
           ]
        },
        {
            "name": "api",
            "properties": [
                    {
                        "key":"xss.filter.header.X-Frame-Options",
                        "value":""
                    }
            ],
            "webapps": [
                {
                    "name": "ycommercewebservices",
                    "contextPath": "/rest"
                },
                {
                    "name": "oauth2",
                    "contextPath": "/authorizationserver"
                },
                {
                    "name": "cmswebservices",
                    "contextPath": "/cmswebservices"
                },
                {
                    "name": "permissionswebservices",
                    "contextPath": "/permissionswebservices"
                }
            ]
        }
    ],

Webapps Aspect

Web applications (web module part of extensions) that are enabled in a given aspect.

aspect 里启用的 Web Application, 即 Extensions 对应的 web module 局部。

These web applications influence the Tomcat server configuration for a given aspect. Only these extensions are installed as web applications in the Tomcat server.

这些 web 利用可能影响某个 aspect 对应的 tomcat server 配置。只有这些 Extensions 才会以 web 利用的形式,装置到 tomcat 服务器上。

It only controls the web part of extensions, while the extension list is the same for all aspects. You can’t enable or disable a particular extension in a particular aspect, because all Platform instances in the cluster must run the same business logic.

web aspect 只能管制 Extensions 的 web 局部,对于所有 aspect 来说 Extension list 都是一样的。

咱们不能为某个特定的 aspect 启用或者禁用某个特定的 extension, 因为一个集群上所有平台实例都必须运行同样的业务逻辑。

The effective list of enabled web applications may differ from those defined in the manifest due to mandatory web applications that are always enabled by SAP Commerce Cloud, like mediaweb.

最终运行时启用的 web 利用可能会和 manifest.json 里定义的 web 利用条目数不统一,因为有的 web 利用,比方 mediaweb,默认会总是启用。

The administration aspect can’t define any web application because it’s intended to be headless (no Tomcat server is started).

administration aspect 无奈定义任何 web 利用,因为原则上说,Administration aspect 的设计就是 headless 的,没有 tomcat 服务器启动。

Properties

每个 aspect 都能够设定肯定数量的 properties.

Set the properties in the local.properties file. The deployment process can force some properties, such as db.url.

在 local.properties 里定义 properties.

每个 Properties 能够定义四个 属性 (attributes):

  1. key: Defines the property key. This attribute is required.
  2. value: Defines the property value. This attribute is required.
  3. persona: Sets a given property for a specific environment type (development, staging, and production).
  4. secret: Indicates a property value that is secret, for example, a password. Values set to secret are excluded from build logs.

例子:

 ],
    "properties": [
        {
            "key": "test.property.1",
            "value": "test.property.1.value",
            "persona": "production"
        },
        {
            "key": "test.property.2",
            "value": "test.property.2.value",
            "persona": "development"
        },
        {
            "key": "test.property.2",
            "value": "test.property.2.value.in.prod.only",
            "persona": "production"
        }
    ],

下列两个 Properties 对进步 SAP Commerce Cloud 数据库性能有所帮忙:

 },
        {
            "key": "auditing.enabled",
            "value": "false"
        },
        {
            "key": "default.session.timeout",
            "value": "360",
        },
        
  1. auditing.enabled=false prevents the auditing of changes to items within SAP Commerce Cloud. For more information, see Generic Audit.
  2. default.session.timeout=360 limits the storage time for a session in the database to 360 seconds. For more information, see Jalo Session.

在 Commerce Cloud build 阶段,下列这些 Properties 会被填充上默认值。

更多 Jerry 的原创文章,尽在:” 汪子熙 ”:

正文完
 0