Skip to content

Commit 0e33b48

Browse files
committed
fixup docs a little; expand test a little
1 parent 08b8c32 commit 0e33b48

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

docs/plugins.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,37 @@ nodes:
1111
<<snip>>
1212

1313
plugins:
14-
preNode: # Run commands before each node launches
15-
- "echo This is preNode" # This command is a simple string
16-
postNode: # Run commands after each node launches
17-
- exec: "echo This is also postNode, but we waited for 'warnet status'" # This command is also a simple string ...
18-
waitFor: "warnet status" # ... but it will execute after this command completes successfully
19-
- exec: "echo This is postNode" # Simply using 'exec' also just works
20-
preDeploy: # Run commands before Warnet runs the bulk of its `deploy` code
21-
- "echo This is preDeploy"
22-
postDeploy: # Run these commands after Warnet has finished the bulk of its `deploy` code
23-
- "../../plugins/simln/plugin.py launch-activity '[{\"source\": \"tank-0003-ln\", \"destination\": \"tank-0005-ln\", \"interval_secs\": 1, \"amount_msat\": 2000}]'"
24-
- exec: "../../plugins/simln/plugin.py list-pod-names"
25-
waitFor: "../../plugins/simln/plugin.py get-example-activity"
14+
preDeploy:
15+
hello:
16+
entrypoint: "../plugins/hello"
17+
podName: "hello-pre-deploy"
18+
helloTo: "preDeploy!"
19+
postDeploy:
20+
simln:
21+
entrypoint: "../../../resources/plugins/simln"
22+
activity: '[{"source": "tank-0003-ln", "destination": "tank-0005-ln", "interval_secs": 1, "amount_msat": 2000}]'
23+
hello:
24+
entrypoint: "../plugins/hello"
25+
podName: "hello-post-deploy"
26+
helloTo: "postDeploy!"
27+
preNode:
28+
hello:
29+
entrypoint: "../plugins/hello"
30+
helloTo: "preNode!"
31+
postNode:
32+
hello:
33+
entrypoint: "../plugins/hello"
34+
helloTo: "postNode!"
35+
preNetwork:
36+
hello:
37+
entrypoint: "../plugins/hello"
38+
helloTo: "preNetwork!"
39+
podName: "hello-pre-network"
40+
postNetwork:
41+
hello:
42+
entrypoint: "../plugins/hello"
43+
helloTo: "postNetwork!"
44+
podName: "hello-post-network"
2645
````
2746

2847
Warnet will execute these plugin commands after each invocation of `warnet deploy`.

test/data/ln/network.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ plugins:
6363
simln:
6464
entrypoint: "../../../resources/plugins/simln"
6565
activity: '[{"source": "tank-0003-ln", "destination": "tank-0005-ln", "interval_secs": 1, "amount_msat": 2000}]'
66+
hello:
67+
entrypoint: "../plugins/hello"
68+
podName: "hello-post-deploy"
69+
helloTo: "postDeploy!"
6670
preNode:
6771
hello:
6872
entrypoint: "../plugins/hello"

test/simln_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def found_results_locally(self) -> bool:
8686

8787
def assert_hello_plugin(self):
8888
self.log.info("Waiting for the 'hello' plugin pods.")
89-
wait_for_pod("hello-pre-deploy") # We don't use post-deploy (simln covers that)
89+
wait_for_pod("hello-pre-deploy")
90+
wait_for_pod("hello-post-deploy")
9091
wait_for_pod("hello-pre-network")
9192
wait_for_pod("hello-post-network")
9293
wait_for_pod("tank-0000-post-hello-pod")

0 commit comments

Comments
 (0)