我剛開始學習groovy.I想在svn copy命令中將svnSourcePath和svnDestPath傳遞給shell腳本。但URL未呈現。將groovy變量傳遞給shell腳本
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
到低估了這個問題的人 - 沒有給出解釋就有什麼意義? –