s.prod.yaml 5.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # ------------------------------------
  2. # If you need English case, you can refer to [s_en.yaml] file
  3. # ------------------------------------
  4. # 欢迎您使用阿里云函数计算 FC 组件进行项目开发
  5. # 组件仓库地址:https://github.com/devsapp/fc
  6. # 组件帮助文档:https://www.serverless-devs.com/fc/readme
  7. # Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
  8. # 关于:
  9. # - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
  10. # - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
  11. # 等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
  12. # 关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
  13. # 关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
  14. # 更多函数计算案例,可参考:https://github.com/devsapp/awesome/
  15. # 有问题快来钉钉群问一下吧:33947367
  16. # ------------------------------------
  17. edition: 1.0.0
  18. name: state-grid-invoice-filling
  19. # access 是当前应用所需要的密钥信息配置:
  20. # 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
  21. # 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
  22. access: default
  23. vars: # 全局变量
  24. region: cn-shanghai
  25. service:
  26. name: stategrid-service
  27. description: '电网项目'
  28. services:
  29. framework: # 业务名称/模块名称
  30. # 如果只想针对 framework 下面的业务进行相关操作,可以在命令行中加上 framework,例如:
  31. # 只对framework进行构建:s framework build
  32. # 如果不带有 framework ,而是直接执行 s build,工具则会对当前Yaml下,所有和 framework 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
  33. component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
  34. actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
  35. # pre-deploy: # 在deploy之前运行
  36. # - run: mvn package -DskipTests # 要执行的系统命令,类似于一种钩子的形式
  37. # path: ./code # 执行系统命令/钩子的路径
  38. # - component: fc build --use-docker # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
  39. # - plugin: myplugin # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
  40. # args: # 插件的参数信息
  41. # testKey: testValue
  42. # post-deploy: # 在deploy之后运行
  43. # - component: fc versions publish # 要运行的命令行
  44. props: # 组件的属性值
  45. region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
  46. service: ${vars.service}
  47. function:
  48. name: invoice-filling
  49. description: '发票确认'
  50. codeUri: ../target/invoice-0.0.6.jar
  51. runtime: custom
  52. memorySize: 1024
  53. timeout: 30
  54. customRuntimeConfig:
  55. command:
  56. - java
  57. args:
  58. - 'org.springframework.boot.loader.JarLauncher'
  59. triggers:
  60. - name: httpTrigger
  61. type: http
  62. config:
  63. authType: anonymous
  64. methods:
  65. - GET
  66. - POST
  67. - PUT
  68. - DELETE
  69. - HEAD
  70. - OPTIONS
  71. customDomains:
  72. - domainName: invoice-filling.stategrid.njyunzhi.com
  73. protocol: HTTP
  74. routeConfigs:
  75. - path: /*
  76. # next-function: # 第二个函数的案例,仅供参考
  77. # # 如果在当前项目下执行 s deploy,会同时部署模块:
  78. # # helloworld:服务hello-world-service,函数cpp-event-function
  79. # # next-function:服务hello-world-service,函数next-function-example
  80. # # 如果想单独部署当前服务与函数,可以执行 s + 模块名/业务名 + deploy,例如:s next-function deploy
  81. # # 如果想单独部署当前函数,可以执行 s + 模块名/业务名 + deploy function,例如:s next-function deploy function
  82. # # 更多命令可参考:https://www.serverless-devs.com/fc/readme#文档相关
  83. # component: fc
  84. # props:
  85. # region: ${vars.region}
  86. # service: ${vars.service} # 应用整体的服务配置
  87. # function: # 定义一个新的函数
  88. # name: next-function-example
  89. # description: 'hello world by serverless devs'