Skip to main content

支付宝 云

APP_ID=1234
CLOUD_ENV=prod
docker tag mysvr registry.cloudrun.cloudbaseapp.cn/cloudrun-$APP_ID-$CLOUD_ENV/mysvr:v1.0.0
  • callContainer 调用服务

费用

服务计费
CPU¥ 0.052/核/h
内存¥ 0.03/G/h
持久卷¥ 0.002/G/h
流量¥ 0.08/G/h
构建¥ 0.03/分钟

API

curl 'https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.open.mini.order.query&app_id=35970&sign_type=RSA2&sign=&version=1.0&charset=GBK&biz_content=AlipayOpenMiniOrderQueryQueryModel'
  • alipay.open.app.qrcode.create -> alipayOpenAppQrcodeCreate
conffor
ServiceURLhttps://openapi.alipay.com/gateway.do
APPID
PRIVATE_KEY
FORMATJSON
CHARSET
ALIPAY_PUBLIC_KEY
SIGN_TYPERSA2
app_cert_path
alipay_cert_path
alipay_root_cert_path

Sign

CPT

  • CPT - CloudPiloT
    • 迁移和运维
  • 全局设置 - 全局管理 - CPT密钥
  • cloudbase 云开发
  • cloudrun 云托管
  • PRIVATE_KEY
# macOS
curl -L -o ~/bin/cpt https://public-hz.oss.cloudrun.cloudbaseapp.cn/cpt/darwin_amd64/cpt
chmod +x ~/bin/cpt
# xattr -d com.apple.quarantine cpt

# Linux
curl -LO https://public-hz.oss.cloudrun.cloudbaseapp.cn/cpt/linux_amd64/cpt

cpt --version
cpt login --appid $APPID --private_key $PRIVATE_KEY

# 持久化登录 Docker - 默认 8h
docker login registry.cloudrun.cloudbaseapp.cn --username cloudrun --password $(cpt cloudrun print-token --quiet)

cpt whoami # APP_ID

cpt cloudrun env list # 环境列表
cpt cloudrun env list-eip # 获取对外请求的 IP - Egress IP

cpt cloudrun service list # 服务
# 部署
cpt cloudrun deploy --env prod --service server --image registry.cloudrun.cloudbaseapp.cn/cloudrun-$APP_ID-$APP_ENV/$APP_SERVIE:latest

faas-server-sdk

import Cloud from '@alipay/faas-server-sdk';
const { CLOUD_ENV = 'prod' } = process.env;

Cloud.init({
env: CLOUD_ENV,
timeout: 10000,
});