【发布时间】:2019-11-06 04:35:28
【问题描述】:
我有一个 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 并使用它?
【问题讨论】:
-
你能指导我去哪里看吗?
-
使用双引号而不是单引号将常规(管道)值插入字符串。像这样:
sh """ ... mkdir -p builds/${pipelineValue}/libs/... """
标签: shell groovy jenkins-pipeline