简体   繁体   English

如何在Groovy文件的Jenkins管道中执行svn签出?

[英]How to execute a svn checkout in a Jenkins Pipeline in a Groovy file?

I have a script in groovy and I need to execute a svn Checkout. 我在groovy中有一个脚本,我需要执行svn Checkout。 Here's what I have : 这是我所拥有的:


"cmd /c \"svn checkout PATHtoSVN PATHtoDIRECTORY\"".execute()

But it doesn't work. 但这是行不通的。 Can someone help me ? 有人能帮我吗 ? Thx. 谢谢。

Emile, why don't you try to use the general checkout step in your pipeline code? Emile,为什么不尝试在管道代码中使用常规的结帐步骤?

checkout([$class: 'SubversionSCM', locations: [[credentialsId: 'svn-server', local: '.', remote: '<SVN URL>']]])

See https://JENKINS_SERVER_HOSTNAME/job/PIPELINE_NAME/pipeline-syntax/ for full step syntax. 有关完整步骤的语法,请参见https:// JENKINS_SERVER_HOSTNAME / job / PIPELINE_NAME / pipeline-syntax /

Please mind that the svn Step is easier but does not allow to specify potentially needed credentials... 请注意, svn步骤比较容易,但是不允许指定潜在需要的凭据...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM