Read pod template yaml from library resource

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      I'd like to move pod definition from pipeline to a file resource in a shared library.
       
      My pipeline is like:

      pipeline {
          agent none
          stages {     
              stage('step-in-kubernetes') {
                  agent {
                      kubernetes {
                          label 'kube'
                          yamlFile libraryResource('myPod.yaml')
                      }
                  }       
                  stages {
                      stage('Checkout') {
                          steps {
                              checkout([$class: 'MercurialSCM', clean: true,
                                  source: 'https://acme.com/hg/myproject'])
                          }
                      }
      
                  } 
              }
          }
      }
      

       
      I put 'myPod.yaml' in resources folder of my library.
      I get an error saying that HG is not installed.

      But:

      • it's work if I used yaml property instead of yamlFile
      • libraryResource fails when using wrong filename
         

            Assignee:
            Carlos Sanchez
            Reporter:
            Arnaud Bourree
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: