詹金斯管道报价环境变量 [英] Jenkins pipeline quoting environmental variables
本文介绍了詹金斯管道报价环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
詹金斯的名言让我有些痛苦.我正在尝试对存储库进行一些更改,并在提交消息中包含一些标识详细信息
I have a little bit of pain with Jenkins quotes. I'm trying to commit some changes to the repository and include in commit message few identification details
stage('Commit changes') {
steps {
wrap([$class: 'BuildUser']) {
dir('deployment')
{
sh '''git commit -m "Creating new server in $VENDOR by"'''env.BUILD_USER_ID'''", buildID: "'''env.BUILD_ID'''" completed"'''
sh 'git push origin $SRC'
}
}
}
}
以上是我的糟糕尝试的第n次迭代.我感谢如何解决此问题的任何想法.
The above is n-th iteration of my poor attempts. I appreciate any ideas how to solve this.
推荐答案
尝试一下:
sh("""
git commit -m "Creating new server in ${VENDOR} by ${env.BUILD_USER_ID}, buildID: ${env.BUILD_ID} completed"
git push origin ${SRC}
""")
这篇关于詹金斯管道报价环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文