我有一个Groovy文件,需要在shell脚本中使用管道参数:
def call() {
echo "current build number: ${currentBuild.number}"
def pipelineValue = "${currentBuild.number}"
sh '''
cd /jenkins/jenkins/workspace/Run_Distribution_Self_Service/
mkdir -p builds/{pipelineValue }/libs/jfrog_distribution_shared_lib/resources/com/amdocs/python_distribution_util
'''
如何在shell脚本中获取pipelineValue并使用它?
答案 0 :(得分:1)
正确的语法:
mkdir -p builds/'''+pipelineValue+'''/libs/jfrog_distribution_shared_lib/resources/com/amdocs/python_distribution_util
以下链接对我有帮助: Pass groovy variable to shell script
答案 1 :(得分:0)
let twoSingletons k v =
[ TreeNode(k, v, EmptyTree, EmptyTree)
TreeNode(k, v, EmptyTree, EmptyTree) ]