[云开发3]-将问卷调查Demo应用快速部署到SAP云平台

快速部署到SAP云平台Cloud Foundry

阅读这篇blog大约需要5分钟

在这里插入图片描述

在Demo原型开发后的第一时间部署到云平台。

Be slow to promise and quick to perform.

部署前端UI5应用

修改index.html的sap-ui-core.js位置:

<script id="sap-ui-bootstrap"
			src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"

UI5应用的运行环境是staticfile_buildpack,创建manifest.yml文件:

---
applications:
- name: arctic
  random-route: true
  path: .
  buildpack: staticfile_buildpack
  memory: 256M

部署应用:

cf push

输出:

...

Staging app and tracing logs...
   Uploaded droplet (24.5M)
   Uploading complete
   Cell 3adf9482-65af-48ef-86a3-a23b9adc0bc8 stopping instance ea800892-571a-4ad6-97eb-baf6346b0c3e
   Cell 3adf9482-65af-48ef-86a3-a23b9adc0bc8 destroying container for instance ea800892-571a-4ad6-97eb-baf6346b0c3e
   Cell 3adf9482-65af-48ef-86a3-a23b9adc0bc8 successfully destroyed container for instance ea800892-571a-4ad6-97eb-baf6346b0c3e

Waiting for app to start...

name:                arctic
requested state:     started
isolation segment:   trial
routes:              arctic-chatty-jackal.cfapps.eu10.hana.ondemand.com
last uploaded:       Thu 13 Feb 21:49:15 CST 2020
stack:               cflinuxfs3
buildpacks:          staticfile

type:            web
instances:       1/1
memory usage:    256M
start command:   $HOME/boot.sh
     state     since                  cpu    memory         disk         details
#0   running   2020-02-13T13:49:33Z   0.0%   1.6M of 256M   131M of 1G

页面地址:

https://arctic-chatty-jackal.cfapps.eu10.hana.ondemand.com/webapp/

部署后端Node.js应用

Sails.js的CORS配置, security.js:

  cors: {
    allRoutes: true,
    allowOrigins: '*',
    allowCredentials: false,
  },

Sails.js应用和部署Node.js完全一样,创建manifest.yml:

---
applications:
- name: arctic-backend
  random-route: true
  path: .
  buildpack: nodejs_buildpack
  memory: 768M

部署应用:

cf push

输出:

...

 Cell d8eab7bd-8f13-4598-a26b-00bb71b3764b destroying container for instance 0b198393-d057-499e-8283-8b4836de6ee9
   Cell d8eab7bd-8f13-4598-a26b-00bb71b3764b successfully destroyed container for instance 0b198393-d057-499e-8283-8b4836de6ee9

Waiting for app to start...

name:                arctic-backend
requested state:     started
isolation segment:   trial
routes:              arctic-backend-silly-cassowary.cfapps.eu10.hana.ondemand.com
last uploaded:       Thu 13 Feb 21:11:11 CST 2020
stack:               cflinuxfs3
buildpacks:          nodejs

type:            web
instances:       1/1
memory usage:    768M
start command:   npm start
     state     since                  cpu     memory          disk         details
#0   running   2020-02-13T13:11:41Z   56.0%   48.3M of 768M   198M of 1G

API服务地址:

https://arctic-backend-silly-cassowary.cfapps.eu10.hana.ondemand.com

小结

通过SAP云平台Cloud Foundry部署云应用超级方便,让PaaS平台帮你去管理一切。你要做的就是CF PUSH。

参考阅读

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值