You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A standard yaml configuration file format is given below:
144
142
@@ -147,50 +145,34 @@ dagrs:
147
145
a:
148
146
name: "Task 1"
149
147
after: [ b, c ]
150
-
run:
151
-
type: sh
152
-
script: echo a
148
+
cmd: echo a
153
149
b:
154
150
name: "Task 2"
155
151
after: [ c, f, g ]
156
-
run:
157
-
type: sh
158
-
script: echo b
152
+
cmd: echo b
159
153
c:
160
154
name: "Task 3"
161
155
after: [ e, g ]
162
-
run:
163
-
type: sh
164
-
script: echo c
156
+
cmd: echo c
165
157
d:
166
158
name: "Task 4"
167
159
after: [ c, e ]
168
-
run:
169
-
type: sh
170
-
script: echo d
160
+
cmd: echo d
171
161
e:
172
162
name: "Task 5"
173
163
after: [ h ]
174
-
run:
175
-
type: sh
176
-
script: echo e
164
+
cmd: echo e
177
165
f:
178
166
name: "Task 6"
179
167
after: [ g ]
180
-
run:
181
-
type: deno
182
-
script: Deno.core.print("f\n")
168
+
cmd: python3 ./tests/config/test.py
183
169
g:
184
170
name: "Task 7"
185
171
after: [ h ]
186
-
run:
187
-
type: deno
188
-
script: Deno.core.print("g\n")
172
+
cmd: node ./tests/config/test.js
189
173
h:
190
174
name: "Task 8"
191
-
run:
192
-
type: sh
193
-
script: echo h
175
+
cmd: echo h
194
176
```
195
177
196
178
These yaml-defined task items form a complex dependency graph. In the yaml configuration file:
@@ -199,7 +181,8 @@ These yaml-defined task items form a complex dependency graph. In the yaml confi
199
181
- Similar to `a`, `b`, `c`... is the unique identifier of the task
200
182
- `name`is a required attribute, which is the name of the task
201
183
- `after`is an optional attribute (only the first executed task does not have this attribute), which represents which tasks are executed after the task, that is, specifies dependencies for tasks
202
-
- `run` is a required attribute, followed by `type` and `script`, they are all required attributes, where `type` represents the type of task. The framework provides default implementations of the `Action` trait for two types of script tasks, namely sh and javascript. If users want to customize other types of script tasks, or implement their own script execution logic, they can implement the `Action` trait by programming. Although this is cumbersome, this method will be more flexible. In addition, when parsing the configuration file, the user also needs to provide the parser with a specific type that implements the `Action` trait, and the method should be in the form of a key-value pair: <id,action>
184
+
- `cmd` is a optional attribute. You need to point out the command to be executed, such as the basic shell command: `echo hello`, execute the python script `python test.py`, etc. The user must ensure that the interpreter that executes the script exists in the environment variable. `CommandAction` is the implementation of the specific execution logic of the script, which is put into a specific `Task` type.
185
+
If users want to customize other types of script tasks, or implement their own script execution logic, they can implement the "Action" feature through programming, and when parsing the configuration file, provide the parser with a specific type that implements the `Action` feature, and the method should be in the form of a key-value pair: <id,action>. Although this is more troublesome, this method will be more flexible.
203
186
204
187
To parse the yaml configured file, you need to compile this project, requiring rust version >= 1.70:
0 commit comments