如何将管道参数传递给Shell脚本

我有一个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并使用它?

z376769188 回答:如何将管道参数传递给Shell脚本

正确的语法:

mkdir -p builds/'''+pipelineValue+'''/libs/jfrog_distribution_shared_lib/resources/com/amdocs/python_distribution_util

以下链接对我有帮助: Pass groovy variable to shell script

,
let twoSingletons k v = 
  [ TreeNode(k,v,EmptyTree,EmptyTree)
    TreeNode(k,EmptyTree) ] 
本文链接:https://www.f2er.com/3167365.html

大家都在问