【发布时间】:2017-05-24 00:37:33
【问题描述】:
我刚开始学习 groovy。我想在 svn copy 命令中将 svnSourcePath 和 svnDestPath 传递给 shell 脚本。但 URL 未呈现。
node {
stage 'Copy Svn code'
def svnSourcePath = "${svnBaseURL}${svnAppCode}${svnEnvDev}${SVN_DEV_PACKAGE}"
def svnDestPath = "${svnBaseURL}${svnAppCode}${svnEnvTest}${SVN_DEV_PACKAGE}"
print "DEBUG: svnSourcePath = ${svnSourcePath}"
print "DEBUG: svnDestPath = ${svnDestPath}"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: crendentialsIdSVN, passwordVariable: 'SVN_PWD', usernameVariable: 'SVN_USER']]) {
sh '''
svn copy $svnSourcePath $svnDestPath -m 'promote dev to test' --username $SVN_USER --password $SVN_PWD '''
}
}
输出
+ svn copy -m 'promote dev to test' --username techuser --password 'xxxyyy'
svn: E205001: Try 'svn help' for more info
svn: E205001: Not enough arguments provided
【问题讨论】:
-
致对这个问题投反对票的人 - 在不解释的情况下投反对票有什么意义?
标签: shell jenkins groovy cloudbees