feat: add fun template.yml
This commit is contained in:
@@ -7,6 +7,7 @@ Use this template you need to install:
|
||||
* Kickstart - https://crates.io/crates/kickstart
|
||||
* Docker - https://github.com/docker/docker-ce
|
||||
* Dockerbuild - https://crates.io/crates/dockerbuild
|
||||
* Fun and Config Fun - https://github.com/alibaba/funcraft
|
||||
* Just - https://crates.io/crates/just
|
||||
|
||||
|
||||
@@ -30,6 +31,11 @@ Deploy:
|
||||
|
||||

|
||||
|
||||
Build and deploy:
|
||||
```shell
|
||||
$ just builddeply
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
Sample output:
|
||||
|
||||
@@ -47,3 +47,21 @@ choices = [
|
||||
name = "description"
|
||||
default = "A Alibaba Cloud Function application"
|
||||
prompt = "A short description of the app?"
|
||||
|
||||
[[variables]]
|
||||
name = "fnservice"
|
||||
default = "my-service"
|
||||
prompt = "You fn service name?"
|
||||
validation = "^([a-zA-Z][a-zA-Z0-9_-]+)$"
|
||||
|
||||
[[variables]]
|
||||
name = "fnfunction"
|
||||
default = "my-function"
|
||||
prompt = "You fn function name?"
|
||||
validation = "^([a-zA-Z][a-zA-Z0-9_-]+)$"
|
||||
|
||||
[[variables]]
|
||||
name = "fnevent"
|
||||
default = "None"
|
||||
prompt = "Your fn http event(or None)?"
|
||||
validation = "^([a-zA-Z][a-zA-Z0-9_-]+)$"
|
||||
|
||||
@@ -8,3 +8,5 @@ buildfn:
|
||||
zip code.zip bootstrap {{bin}}
|
||||
rm {{bin}}
|
||||
|
||||
builddeply: buildfn
|
||||
fun deploy
|
||||
|
||||
23
{{project_name}}/template.yml
Normal file
23
{{project_name}}/template.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
ROSTemplateFormatVersion: '2015-09-01'
|
||||
Transform: 'Aliyun::Serverless-2018-04-03'
|
||||
Resources:
|
||||
{{fnservice}}:
|
||||
Type: 'Aliyun::Serverless::Service'
|
||||
Properties:
|
||||
Description: '{{description}}'
|
||||
{{fnfunction}}:
|
||||
Type: 'Aliyun::Serverless::Function'
|
||||
Properties:
|
||||
Handler: index.handler
|
||||
MemorySize: 128
|
||||
CodeUri: './code.zip'
|
||||
Description: '{{description}}'
|
||||
Runtime: custom
|
||||
{% if fnevent != "None" -%}
|
||||
Events:
|
||||
{{fnevent}}:
|
||||
Type: HTTP
|
||||
Properties:
|
||||
AuthType: ANONYMOUS
|
||||
Methods: ['GET', 'POST', 'PUT']
|
||||
{%- endif %}
|
||||
Reference in New Issue
Block a user