SAP BTP点滴

构建并部署项目

前提条件:

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 文件。

部署

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值