3
0

yaml2Map.groovy 389 B

123456789101112131415161718
  1. def read(String filePath) {
  2. def pipelineCfg = readYaml(file: filePath)
  3. return pipelineCfg
  4. }
  5. def merge(Object project, Object global) {
  6. def result = global.clone()
  7. project.each { key, value ->
  8. if (value instanceof Map && result[key] instanceof Map) {
  9. result[key] = merge(value, result[key])
  10. } else {
  11. result[key] = value
  12. }
  13. }
  14. return result
  15. }
  16. return this