yaml2Map.groovy 675 B

1234567891011121314151617181920212223242526
  1. // file -> Map
  2. def read(String filePath) {
  3. def pipelineCfg = readYaml(file: filePath)
  4. return pipelineCfg
  5. }
  6. // 用project 覆盖 global
  7. def merge(Object project, Object global) {
  8. global.k3s = global.k3s + (project.k3s == null ? [:] : project.k3s)
  9. global.docker = global.docker + (project.docker == null ? [:] : project.docker)
  10. global.git = (global.git == null ? [:] : global.git) + (project.git == null ? [:] : project.git)
  11. global.service = project.service
  12. global.skywalking = project.skywalking
  13. if (project.ssh != null) {
  14. global.ssh = project.ssh
  15. }
  16. if (project.files != null) {
  17. global.files = project.files
  18. }
  19. return global
  20. }
  21. return this