From 9f42e56c536eacd2a49a36eff1b554f4aefaf268 Mon Sep 17 00:00:00 2001 From: Brian H Date: Wed, 26 Jun 2024 11:29:46 -0600 Subject: [PATCH] Update template to generate v2 manifests Signed-off-by: Brian H --- templates/mqtt-rust/content/spin.toml | 30 +++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/templates/mqtt-rust/content/spin.toml b/templates/mqtt-rust/content/spin.toml index 67d91a4..a6841de 100755 --- a/templates/mqtt-rust/content/spin.toml +++ b/templates/mqtt-rust/content/spin.toml @@ -1,16 +1,24 @@ -spin_manifest_version = "1" +spin_manifest_version = 2 + +[application] +name = "{{project-name | kebab_case}}" +version = "0.1.0" authors = ["{{authors}}"] description = "{{project-description}}" -name = "{{project-name}}" -trigger = { type = "mqtt", address = "{{mqtt-address}}", username = "{{mqtt-username}}", password = "{{mqtt-password}}", keep_alive_interval = "{{mqtt-keep_alive_interval}}" } -version = "0.1.0" -[[component]] -id = "{{project-name | kebab_case}}" -source = "target/wasm32-wasi/release/{{project-name | snake_case}}.wasm" -allowed_outbound_hosts = ["{{mqtt-address}}"] -[component.trigger] +[application.trigger.mqtt] +address = "{{mqtt-address}}" +username = "{{mqtt-username}}" +password = "{{mqtt-password}}" +keep_alive_interval = "{{mqtt-keep_alive_interval}}" + +[[trigger.mqtt]] +component = "{{project-name | kebab_case}}" topic = "{{mqtt-topic}}" qos = "{{mqtt-qos}}" -[component.build] -command = "cargo build --target wasm32-wasi --release" + +[component.{{project-name | kebab_case}}] +source = "target/wasm32-wasi/release/{{project-name | snake_case}}.wasm" +allowed_outbound_hosts = ["{{mqtt-address}}"] +[component.{{project-name | kebab_case}}.build] +command = "cargo build --target wasm32-wasi --release" \ No newline at end of file