ENV:詹金斯2.73.1 & Kubernetes插件1.0如何使用kubernetes插件將jenkins構建環境轉換爲pod?
容器內,我希望得到正常的詹金斯生成環境變量像BUILD_NUMBER
podTemplate(label: 'mypod', containers: [ containerTemplate(name: 'python', image: 'python:2.7.8', ttyEnabled: true) ]) { node("mypod") { echo sh(returnStdout: true, script: 'env') container('python') { stage('Checkout') { sh "env" } } } }
所以在上面的代碼遠,裏面python
,它沒有傳統的構建變量。
任何解決方案來獲取容器內的這些變量?
我得到錯誤代碼:詹金斯沒有標籤mypod在詹金斯和無法啓動POD。任何想法? –