3
0

Jenkinsfile 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. def deployNamespace = 'ahxpm'
  8. dir("k3s-INFRA/DEV/traefik-rules") {
  9. def PROJECT_CONFIG = yaml2Map.read('cfg.yaml').project
  10. def CONFIG = yaml2Map.merge(PROJECT_CONFIG, GLOBAL_CONFIG)
  11. services = services.split(',')
  12. for(service in services) {
  13. stage("Apply service ${service}") {
  14. final foundFiles = findFiles(glob: "${service}/*.yaml")
  15. foundFiles.each {
  16. println "applying ${it}..."
  17. k3sUtils.applyService(CONFIG.k3s, "${it}", deployNamespace)
  18. }
  19. }
  20. }
  21. // final foundFiles = findFiles(glob: '*/*.yaml')
  22. // foundFiles.each{
  23. // stage("apply config ${it}") {
  24. // println "applying ${it}..."
  25. // k3sUtils.applyService(CONFIG.k3s, "${it}")
  26. // }
  27. // }
  28. }
  29. }