3
Q
SVN與搖籃
A
回答
3
從this answer繪畫,這是搖籃的任務,使用SVNKit提交一個文件。
buildscript {
repositories { mavenCentral() }
dependencies { classpath "org.tmatesoft.svnkit:svnkit:1.7.11"}
}
import org.tmatesoft.svn.core.wc2.*
import org.tmatesoft.svn.core.wc.*
import org.tmatesoft.svn.core.*
task svnCommitFile(){
description = "Commits a single file to an SVN repository"
doLast{
if (!project.hasProperty("commitMsg")){
ext.commitMsg = "None"
}
SvnOperationFactory svnOperationFactory = new SvnOperationFactory()
def authentication = SVNWCUtil.createDefaultAuthenticationManager(svnUser, svnPassword)
svnOperationFactory.setAuthenticationManager(authentication)
try {
SvnCommit commit = svnOperationFactory.createCommit()
commit.setSingleTarget(SvnTarget.fromFile(new File(fileToCommit)))
commit.setCommitMessage(commitMsg)
SVNCommitInfo commitInfo = commit.run()
println "Commit info: " + commitInfo
println "Commit message: " + commitMsg
} finally{
svnOperationFactory.dispose()
}
}
}
與
如果提交與詹金斯後每完成承諾項目調用它,你會得到一個無限構建循環,因爲一個承諾導致生成這會導致因此Jenkins應該忽略它自己的提交:在你的項目的構建配置中,去Source Code Management --> Subversion --> Advanced
並且把jenkins
(或者你叫你的自動提交者)添加到Excluded Users
。
相關問題
- 1. 與搖籃
- 2. SparkJava與搖籃
- 3. 與搖籃
- 4. 與搖籃
- 5. 搖籃與GCJ
- 6. 與搖籃
- 7. 與搖籃任務
- 8. 搖籃和搖籃的包裝版本
- 9. 使用與搖籃的IntelliJ
- 10. 聲納與搖籃本地
- 11. 搖籃建立與TransformException
- 12. 構建失敗與搖籃
- 13. 搖籃錯誤
- 14. 搖籃錯誤:
- 15. 誤差搖籃
- 16. Inlcude從搖籃
- 17. 搖籃問題
- 18. 從搖籃
- 19. 使用搖籃
- 20. 在搖籃
- 21. 在搖籃
- 22. 搖籃的NoClassDefFoundError
- 23. 誰在搖籃
- 24. 搖籃:並行
- 25. 搖籃錯誤
- 26. 搖籃:FileHasher
- 27. 搖籃不gradle.bat
- 28. 在搖籃
- 29. 搖籃股票
- 30. 通過搖籃
這是否照顧首先將文件SVN的,如果需要的話,或將需要額外的代碼? –
我敢肯定它添加到SVN第一,不需要額外的代碼。 –
我如何將密碼隱藏在這裏? –