SAP 电商云 Build Manifest Components 的使用方法概述
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:
- Your code or Git repository.
- SAP Commerce Cloud (as defined by the application version).
- MT Module, which provides the SAP internal extensions that were developed to run on SAP Commerce Cloud in the public cloud.
- 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:
- accstorefront: Configures the storefront
- backoffice: Configures Backoffice
- backgroundProcessing: Executes tasks in the background
- admin: Performs ant administration tasks, such as initialization and updatesystem
- 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):
-
key: Defines the property key. This attribute is required.
-
value: Defines the property value. This attribute is required.
-
persona: Sets a given property for a specific environment type (development, staging, and production).
-
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",
},
-
auditing.enabled=false prevents the auditing of changes to items within SAP Commerce Cloud. For more information, see Generic Audit.
-
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 会被填充上默认值。
- 点赞
- 收藏
- 关注作者
评论(0)