简体   繁体   中英

how to switching working copy in jenkins?

i am using jenkins for build process. i have created one job with svn url test.svn.com/branch/branch4 now i want to switch this working copy to test.svn.com/branch/branch5 . how it is possible in jenkins.

when i gave new URL in jenkins, jenkins clean old code and then took checkout. i dont want to clean old code, i just want to update this copy for changed file.

because cleaning working copy and checkout new branch takes more time and occupy network bandwidth also.

i have also installed updated subversion plugin for this issue but it doesn't fulfill my requirement.

please let me know, if any body has any idea regarding this.

i have also gone through below URL.

https://issues.jenkins-ci.org/browse/JENKINS-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel

When you change the repository for a job, Jenkins makes the safest assumption possible, which is that the repositories have no relationship to each other and therefore the workspace needs to be cleaned before a checkout. If it didn't assume this, and you changed between two completely different projects, there is the possibility of conflicting things being left around that could cause problems.

For instance, let's say repo1 has a file 'dirA/myincludes'. repo2 has 'dirB/myincludes'. If the job was changed from repo1 to repo2, and Jenkins did not clean the repo, it is possible that you could have conflicting copies of myincludes in two different directories: 'dirA/myincludes' and 'dirB/myincludes'. Which gets used may be questionable depending on how you build, and could yield vastly different results.

Now, if your goal is to be able to have both branch4 and branch5 built, why not just create a build job for each. To make it easy to do this, when you go to create a new job, one of the options is to create the job as a copy of an existing job.

  1. subversion plugin 1.51 in Jenkins is working fine for update or checkout from svn server.

  2. it also support switching branch when it found other branch URL then existing URL but pre-requisite is local-copy should not be in 'locked' status otherwise it will clean everything and take new checkout.

As you already found out, issue JENKINS-2556 is exactly what you are looking for. It is implemented in subversion plugin version of 1.48 which was released May 20, 2013. Assuming that you have the right plugin release installed. Double check your checkout strategy. It should be update for this to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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