Sample Code for continuous integration between Jenkins and SVN, jenkinssvn
Overview
Jenkins is an open-source continuous integration tool written in Java. It is formerly known as Hudson and can be used to automatically compile, test, and publish projects, this greatly reduces the tedious and repetitive work between teams and accelerates the delivery progress of the entire project.
Download Jenkins & SVN & eclipse from the official website. The version number is not required. We recommend that you use the latest stable version.
- Log on to Jenkins: http: // localhost: 8080
- Log on to SVN: http: // localhost: 3343/csvn
- Log on to SVN with the default admin account. After logging on, click version library-> Create version library.
4. Open eclipse and open the created Java Project
5. Install the svn-eclipse plug-in:
Open the link folder in the eclipse installation directory, copy and decompress the SVN plug-in package to the link folder. Then create a svn. link file, the file content is svn plug-in installation path such as: path = D: \ 360Downloads \ Software \ eclipse-SDK-win32 \ link \ SVN
After the installation is successful, the svn resource library is displayed in eclipse.
6. After the svn plug-in is successfully installed, right-click the project and choose "team"> "share project"> "Enter the version library URL"> specify the trunk folder of the project module. Return to the Java project, click the project Jdemo, right-click -- ", submit code to svn
8. Create a job under Jenkins
Go to the Jenkins homepage and click New,
9. Copy curl.exe & libssh2.dll to the C: \ Windows \ System32 root directory.
10. Create a hook file. Go to the svn installation directory hooks folder, create a post-commit.bat file, create a post request with the request content curl-X post-v-u user: pwd URL (Project Build URL)
Note:-u user: pwd is the Jenkins Logon account and password.
11. After a hook is created and a job is created, the code is automatically built once the code is submitted.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.