Jenkinsfile 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. node {
  2. // Git checkout before load source the file
  3. checkout scm
  4. def yaml2Map = load "./sharedLibs/yaml2Map.groovy"
  5. def k3sUtils = load "./sharedLibs/k3sUtil.groovy"
  6. def GLOBAL_CONFIG = yaml2Map.read('global.yaml').project
  7. dir("k3s-INFRA/DEV/traefik-rules") {
  8. def PROJECT_CONFIG = yaml2Map.read('cfg.yaml').project
  9. def CONFIG = yaml2Map.merge(PROJECT_CONFIG, GLOBAL_CONFIG)
  10. services = services.split(',')
  11. for(service in services) {
  12. stage("Apply service ${service}") {
  13. final foundFiles = findFiles(glob: "${service}/*.yaml")
  14. foundFiles.each {
  15. println "applying ${it}..."
  16. k3sUtils.applyService(CONFIG.k3s, "${it}")
  17. }
  18. }
  19. }
  20. // final foundFiles = findFiles(glob: '*/*.yaml')
  21. // foundFiles.each{
  22. // stage("apply config ${it}") {
  23. // println "applying ${it}..."
  24. // k3sUtils.applyService(CONFIG.k3s, "${it}")
  25. // }
  26. // }
  27. }
  28. }