Solve the problem that jenkins cannot be updated to the latest code in time when packaging

First of all, it is necessary to locate whether it is really impossible to pull the latest code?

The positioning steps are as follows:

1. On SVN, check show log, there is no record

2. Log in to Jenkins, view the output record of the build, Console Output,

      ctrl+f, if you can't find the latest code, you can be sure that you can't pull the latest code.

3. Check whether the Jenkins server time is really inconsistent with the SVN server time?

Solution:

Method 1: Adjust the time of the Jenkins server to the time of the SVN server. (This method has been used, it can be solved)

Method Two:

Method one solves the problem, but is the SVN plugin for Jenkins the SVN revision associated with the timestamp?

View the build log of a Jenkins Job. When using the SVN plugin to update the code, the log is as follows:

Updating svn://repository_path at revision '2015-08-06T08:48:12.490 +0800'

As can be seen from the above, the revision corresponding to this build is indeed the build timestamp.

 

So, can Jenkins' SVN plugin set revision to HEAD when updating code?

The answer is yes, just add the @HEAD suffix to the SVN URL. The Jenkins SVN plugin supports this.

After adding the suffix @HEAD to the SVN URL, the log output after building the Jenkins Job is as follows:

Updating svn://repository_path@HEAD

And this ensures that the updated code is up to date and will not be affected by the time difference between the Jenkins server and the SVN server.

Note: HEAD is the SVN revision keyword, indicating the latest version in the repository.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324992387&siteId=291194637