构建并部署项目
前提条件:
1. 已在本地安装用于部署 MTA 的 cf CLI 的多应用插件
2. 已安装 Cloud MTA 构建工具 (MBT)
3. 已安装MultiApps CF CLI Plugin
https://github.com/cloudfoundry/multiapps-cli-plugin/blob/master/README.md
4. 已安装Make, 常规的做法,大家都是使用安装MinGW包的方法来安装Make, 可以用用Choco和Scoop来安装管理Make
PowerShell安装Choco:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
管理员权限启动PowerShell,然后运行以下命令进行安装:
choco install make
安装其他工具:
choco install grep awk sed touch
安装Scoop:
irm get.scoop.sh | iex
scoop install make
scoop install grep gawk sed touch
生成MTA相关部署配置cds add mta
打包mbt build
mbt build
PS D:\Projects\cpapp> mbt build
[2022-11-29 11:47:48] INFO Cloud MTA Build Tool version 1.2.20
[2022-11-29 11:47:48] INFO generating the "Makefile_20221129114748.mta" file...
[2022-11-29 11:47:48] INFO done
[2022-11-29 11:47:48] INFO executing the "make -f Makefile_20221129114748.mta p=cf mtar= strict=true mode=" command...
[2022-11-29 11:47:49] INFO validating the MTA project
[2022-11-29 11:47:49] INFO running the "before-all" build...
[2022-11-29 11:47:49] INFO executing the "npx -p @sap/cds-dk cds build --production" command...
.[cds] - determining build tasks for project [D:\Projects\cpapp].
[cds] - the following build tasks will be executed
[cds] - {
"build": {
"target": "gen",
"tasks": [
{"for":"hana", "src":"db", "options":{"model":["db","srv","app"]}},
{"for":"nodejs", "src":"srv", "options":{"model":["db","srv","app"]}}
]
}
}
[cds] - building project [D:\Projects\cpapp], clean [true]
[cds] - cds [6.3.2], compiler [3.4.4], home [D:\Projects\cpapp\node_modules\@sap\cds]
.[cds] - done > wrote output to:
gen\db\package.json
gen\db\src\.hdiconfig
gen\db\src\gen\.hdiconfig
gen\db\src\gen\.hdinamespace
gen\db\src\gen\DRAFT.DraftAdministrativeData.hdbtable
gen\db\src\gen\RiskService.DraftAdministrativeData.hdbview
gen\db\src\gen\RiskService.Mitigations.hdbview
gen\db\src\gen\RiskService.Mitigations_drafts.hdbtable
gen\db\src\gen\RiskService.Risks.hdbview
gen\db\src\gen\RiskService.Risks_drafts.hdbtable
gen\db\src\gen\data\sap.ui.riskmanagement-Mitigations.csv
gen\db\src\gen\data\sap.ui.riskmanagement-Mitigations.hdbtabledata
gen\db\src\gen\data\sap.ui.riskmanagement-Risks.csv
gen\db\src\gen\data\sap.ui.riskmanagement-Risks.hdbtabledata
gen\db\src\gen\sap.ui.riskmanagement.Mitigations.hdbtable
gen\db\src\gen\sap.ui.riskmanagement.Risks.hdbtable
gen\db\undeploy.json
gen\srv\.cdsrc.json
gen\srv\package-lock.json
gen\srv\package.json
gen\srv\srv\_i18n\i18n.json
gen\srv\srv\csn.json
[cds] - build completed in 777 ms
[2022-11-29 11:47:52] INFO validating the MTA project
[2022-11-29 11:47:52] INFO building the "cpapp-srv" module...
[2022-11-29 11:47:52] INFO executing the "npm clean-install --production" command...
.npm WARN config production Use `--omit=dev` instead.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'cpapp@1.0.0',
npm WARN EBADENGINE required: { node: '^16.15' },
npm WARN EBADENGINE current: { node: 'v18.12.1', npm: '8.19.2' }
npm WARN EBADENGINE }
.
added 67 packages in 2s
[2022-11-29 11:47:54] INFO the build results of the "cpapp-srv" module will be packaged and saved in the "D:\Projects\cpapp\.cpapp_mta_build_tmp\cpapp-srv" folder
[2022-11-29 11:47:55] INFO finished building the "cpapp-srv" module
[2022-11-29 11:47:55] INFO building the "cpapp-db-deployer" module...
[2022-11-29 11:47:55] INFO executing the "npm install --production" command...
.npm WARN config production Use `--omit=dev` instead.
..
added 31 packages in 3s
[2022-11-29 11:47:59] INFO the build results of the "cpapp-db-deployer" module will be packaged and saved in the "D:\Projects\cpapp\.cpapp_mta_build_tmp\cpapp-db-deployer" folder
[2022-11-29 11:48:03] INFO finished building the "cpapp-db-deployer" module
[2022-11-29 11:48:03] INFO running the "after-all" build...
[2022-11-29 11:48:03] INFO generating the metadata...
[2022-11-29 11:48:03] INFO generating the "D:\Projects\cpapp\.cpapp_mta_build_tmp\META-INF\mtad.yaml" file...
[2022-11-29 11:48:03] INFO generating the MTA archive...
[2022-11-29 11:48:04] INFO the MTA archive generated at: D:\Projects\cpapp\mta_archives\cpapp_1.0.0.mtar
[2022-11-29 11:48:04] INFO cleaning temporary files...
构建将在文件夹 mta_archives 下创建一个包含所有项目资源的 mtar 文件。文章来源地址https://www.toymoban.com/news/detail-552648.html
部署
文章来源:https://www.toymoban.com/news/detail-552648.html
到了这里,关于SAP BTP点滴的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!