Commit 9f801fd
authored
Workflows: Support recursive directories (#795)
* Fix workflow files without path
On commit f909009 the workflow code was
cleaned up, but it broke files that had no `path`.
Error shown is similar to this:
```
destdir = f"{destdir}/{os.path.dirname(entry['origin'])}"
^^^^^^^
UnboundLocalError: cannot access local variable 'destdir' where it is not associated with a value
```
That's because in the previously mentioned commit variable
`default_destdir` that was removed was accidentally changed to `destdir`
instead of `outputdir`.
This patch fixes this problem using the right variable.
* Workflows: Support recursive directories
Current workflow code only supports files within a single directory.
This patch adds the functionality to support recursive directories, so
a workflow like this:
```
ctrlplane:
type: workflow
destdir: ./out
scripts:
- scripts/ctrlplane.sh
files:
- origin: ctrl
```
Will work with the file structure:
```
├── ctrl
│ ├── 00-openstack-ns.yaml
│ ├── 00-operators
│ │ ├── 00-operator-cert-manager.yaml
│ │ ├── 00-operator-cluster-observability.yam
│ │ ├── 00-operator-metallb.yaml
│ │ ├── 00-operator-nmstate.yaml
│ │ └── 00-operator-openstack.yaml
```1 parent ed8148b commit 9f801fd
3 files changed
+82
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1347 | 1379 | | |
1348 | 1380 | | |
1349 | 1381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1449 | 1483 | | |
1450 | 1484 | | |
1451 | 1485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1212 | 1212 | | |
1213 | 1213 | | |
1214 | 1214 | | |
1215 | | - | |
| 1215 | + | |
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1224 | 1222 | | |
1225 | 1223 | | |
1226 | 1224 | | |
1227 | 1225 | | |
1228 | 1226 | | |
1229 | 1227 | | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1237 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1238 | 1241 | | |
1239 | 1242 | | |
1240 | 1243 | | |
| |||
0 commit comments