jenkins k8s插件以声明性语法嵌套了pod

时间:2019-09-22 19:06:49

标签: jenkins jenkins-pipeline jenkins-plugins jenkins-declarative-pipeline kubernetes-jenkins-plugin

我有以下要转换为声明性语法的管道。

 podTemplate(
       cloud: "OCP_CLUSTER", 
       name: "CENTRAL_POD", 
       label: "CENTRAL_POD",
       namespace: "CENTRAL_NS", 
       inheritFrom: "my_pod_image") 
   {
          podTemplate(
                cloud: "OCP_CLUSTER", 
                name: "INTERNAL_POD", 
                label: "INTERNAL_PROD", 
                namespace: "MS_NS", 
                inheritFrom: "my_pod_image") 
             {
                   node("CENTRAL_POD") {
                       stage('Project Setup') {
                            create_k8s_ns('CREATE', "MS_NS")
                       }

                       node("INTERNAL_PROD") {
                           stage('Clone sources') {
                               echo "..."
                           }
                       }
                    }
               }
     }

我检查了以下链接,但没有找到解决方案。 https://github.com/jenkinsci/kubernetes-plugin#nesting-pod-templates

声明性语法是否支持相同的选项?

0 个答案:

没有答案