A management system and method for automatic synchronization download of code warehouse

By introducing the automatic synchronization module into the Jenkins plug-in, automatic uploading and downloading of Artifactory warehouse code is realized, which solves the problems of low manual operation efficiency and high error rate, and improves development efficiency and data security.

CN114697307BActive Publication Date: 2024-09-06ZHIJI AUTOMOTIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210179116.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-09-06
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

During the software development process, uploading and downloading code in the Artifactory warehouse requires manual operations. Especially when the project scale is large, the workload is huge and errors are prone to occur. The existing Jenkins plug-in cannot automatically obtain Artifactory data, resulting in a waste of human resources and an error rate. high.

Method used

Design a management system for automatic synchronization and downloading of code warehouses. The Jenkins plug-in is used to automatically upload or download the code in the Artifactory warehouse. Through the file list crawler module, code update check module and file crawler module, code files are automatically identified and synchronized to reduce manual labor. Operation, adopt authorization mechanism to ensure data security.

Benefits of technology

It realizes the automatic upload and download of code files, reduces manual operation errors, improves work efficiency, ensures the accuracy and security of data synchronization, and reduces the risk of misoperation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114697307B
    Figure CN114697307B
Patent Text Reader

Abstract

A management system for automatic synchronization and downloading of code repositories comprises an Artifactory server and an application computer, wherein the application computer comprises a browser tool component, a Jenkins component, an automatic synchronization module and a local code file repository; the automatic synchronization module comprises a file list crawler module, a file crawler module, a control module and a code update check module; the control module drives the code update check module to check the local code file repository and obtain a local code file list, and the code update check module compares the difference between the local code file list and the warehouse code file list to obtain a list of different code files; the control module drives the file crawler module according to the different code file lists to drive the browser tool component by mobilizing the Jenkins component to obtain code files in the code repository of the Artifactory server; and the control module stores the code files in the local code file repository.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of software development technology, and in particular, relates to a management system and method for automatically synchronizing and downloading code repositories. Background Art

[0002] Artifactory is a Maven warehouse server software that can be used to build a Maven warehouse on the intranet for uploading and publishing of the company's internal public library to improve the convenience of using public code. Artifactory supports all development languages, metadata retrieval of any dimension, cross-language forward and reverse dependency analysis, and has deep recursion, support for multi-active and remote disaster recovery, and is an enterprise-level, highly available binary product management warehouse. 93% of the Fortune 500 companies have already used Artifactory as their core DevOps system.

[0003] like Figure 1 Artifactory manages the code of a project or multiple projects. Each developer develops a software project on a different application computer, uploads the developed code to the Artifactory server, and downloads the code developed by other members of the project team at the same time, and combines it locally into a complete R&D software project.

[0004] Jenkins is an open source continuous integration (CI) tool that provides a user-friendly interface. It is mainly used for continuous and automatic building / testing of software projects and monitoring the operation of external tasks. Jenkins is written in Java and can run in popular servlet containers such as Tomcat or independently. It is usually used in conjunction with version control tools (SCM) and build tools. Commonly used version control tools include SVN and GIT, and build tools include Maven, Ant, and Gradle.

[0005] As an open source continuous integration tool, Jenkins is widely used in daily development, integration, deployment and other aspects.

[0006] Artifactory is used as a product library to store the file data required for Jenkins job construction.

[0007] Many functions of Jenkins are implemented through plug-ins. In normal use, some basic plug-ins can meet the requirements. However, the open source plug-ins provided by Jenkins cannot automatically obtain data from artifactory. The existing plug-ins are directly hard-coded for maintenance. Develop your own plug-in to automatically obtain Artifactory data, thereby saving manpower, reducing the error rate caused by manual writing, and realizing automated tasks.

[0008] Artifactory is a warehouse server software. It serves as a database for project teams to store and exchange codes during the software development process. It plays an important role in the software development process. Software developers need to upload their own codes or executable components to the Artifactory server, and also need to download codes developed by other members of the project team. However, the uploading and downloading process requires manual operation. When the scale of the project is large, the workload of uploading and downloading is huge and errors are prone to occur. Summary of the invention

[0009] The present invention utilizes the convenience of Jenkins to make plug-ins, realizes the function of automatically uploading or downloading codes in the Artifactory warehouse, actively finds different code files, automatically realizes the uploading and downloading of code files, eliminates manual operation errors, and reduces the workload of manual operation.

[0010] A management system for automatic synchronization and downloading of code warehouses comprises an Artifactory server and an application computer, wherein the application computer comprises a browser tool component, a Jenkins component, an automatic synchronization module and a local code file library; the automatic synchronization module comprises a file list crawler module, a file crawler module, a control module and a code update check module; the control module drives the file list crawler module to obtain a warehouse code file list in a code warehouse of an Artifactory server by mobilizing a Jenkins component to drive a browser tool component; the control module drives the code update check module to check a local code file library to obtain a local code file list, and the code update check module compares the difference between the local code file list and the warehouse code file list to obtain a list of different code files; the control module drives the file crawler module to obtain code files in a code warehouse of an Artifactory server by mobilizing a Jenkins component according to different code file lists; and the control module stores the code files in the local code file library.

[0011] It can be that the warehouse code file list includes file name, file creation date, file size, and file MD5 check value; the code update check module checks the local code file library, and the local code file list includes file name, file creation date, file size, and file MD5 check value; the code update check module compares the warehouse code file list with the local code file list, and adds files in the local code file list that do not have the file name in the warehouse code file list to different code file lists; the code update check module compares the warehouse code file list with the local code file list, and adds files with the same file name but different MD5 check values ​​or different file sizes to different code file lists; when the control module crawls files with the same file name and different MD5 check values ​​according to different code file lists, it needs to obtain the operator's authorization.

[0012] It may be possible that it also includes a software development project, which includes the code of the local code file library. The software development project can compile and run and debug the code of the local code file library.

[0013] It may also include a file upload module; the control module drives the code update check module to check the local code file library to obtain the local code file list, the code update check module compares the difference between the local code file list and the warehouse code file list to obtain the local new file list; the control module drives the file upload module according to the local new file list and uploads the files in the local new file list to the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool.

[0014] It can be that the code update check module compares the warehouse code file list with the local code file list, and adds the files in the local code file list that are not in the warehouse code file list to the local new file list; the code update check module compares the warehouse code file list with the local code file list, and adds the files with the same file name, different MD5 checksum value, and local file creation date later than the warehouse file creation date to the local new file list.

[0015] It can be that when uploading a local new file list file to the code repository of the Artifactory server, the operator's authorization is required, and the authorization includes but is not limited to specific password authentication and SMS verification code verification of the operator's identity.

[0016] A management method for automatic synchronization download of a code repository,

[0017] Step 10: Obtain the URL address of the Artifactory server from the application computer;

[0018] Step 20: In the Jenkins plug-in, the Jenkins component is called to drive the browser tool component to obtain the repository code file list in the code repository of the Artifactory server;

[0019] Step 30: The Jenkins plug-in obtains the local code file list, compares the local code file list with the warehouse code file list, and obtains the different code file list and the local new file list;

[0020] Step 40: The Jenkins plug-in downloads the code files in the Artifactory server to the local file library according to different code file lists;

[0021] Step 50: The Jenkins plug-in uploads the code files in the local file library to the Artifactory server based on the local new file list.

[0022] It can be that the warehouse code file list includes the file name, file creation date, file size, and the MD5 check value of the file; the local code file list includes the file name, file creation date, file size, and the MD5 check value of the file.

[0023] It can be that in step 30, the warehouse code file list is compared with the local code file list, and the files in the local code file list that do not have the file names in the warehouse code file list are added to the different code file lists; the warehouse code file list is compared with the local code file list, and files with the same file name but different MD5 checksum values ​​or different file sizes are added to the different code file lists; in step 40, when the code files in the Artifactory server are downloaded to the local file library according to the different code file lists, the operator's authorization needs to be obtained.

[0024] It can be that in step 30, the warehouse code file list and the local code file list are compared, and the files in the local code file list that are not in the warehouse code file list are added to the local new file list; the warehouse code file list and the local code file list are compared, and files with the same file name but different MD5 checksum values ​​and local file creation date later than the warehouse file creation date are added to the local new file list; in step 50, when the files in the local new file list are uploaded to the code repository of the Artifactory server, the operator's authorization is required, and the authorization includes but is not limited to specific password authentication and SMS verification code verification of the operator's identity.

[0025] The beneficial effects of the technical solution in this application are: using the file list crawler module in the automatic synchronization module, the file list can be automatically obtained and automatically downloaded according to the list. Greatly improve work efficiency; different files have different MD5 check values. When the automatic synchronization module finds such files, it needs to obtain the operator's authorization before downloading to overwrite local files; local files created late can be added to the local new file list; uploading code to the Artifactory server, the operation design to other developers needs to be cautious, and the operator's authority needs to be verified. The Artifactory server can also record the operator's operation process log for easy backtracking; downloading server files to the local, generally the local operator is affected, and when verifying, the operator can do a simple password authentication authorization; uploading code or files to the Artifactory server, many members are affected, and the operator's authority needs to be strictly authenticated. At the same time, the operator needs to confirm the operation repeatedly to prevent misoperation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic diagram of the relationship between the Artifactory server and the application computer;

[0027] Figure 2 It is a schematic block diagram of a management system for automatic synchronous downloading of code repositories;

[0028] Figure 3 It is a schematic block diagram of a management system for automatic synchronous download of a code repository including a file upload module;

[0029] Figure 4 The present invention is a schematic block diagram of a method for managing automatic synchronous downloading of a code repository. DETAILED DESCRIPTION

[0030] The following is a further detailed description of the present application in conjunction with the accompanying drawings. It should be noted that the following is a description of a preferred embodiment of the present invention and does not constitute any limitation to the present invention. The description of the preferred embodiment of the present invention is only an illustration of the general principle of the present invention.

[0031] like Figure 2A management system for automatic synchronization and downloading of code repositories includes an Artifactory server and an application computer, wherein the application computer includes a browser tool component, a jenkins component, an automatic synchronization module, and a local code file library; the automatic synchronization module includes a file list crawler module, a file crawler module, a control module, and a code update check module; the control module drives the file list crawler module to obtain a warehouse code file list in the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool component; the control module drives the code update check module to check the local code file library to obtain a local code file list, and the code update check module compares the difference between the local code file list and the warehouse code file list to obtain a list of different code files; the control module drives the file crawler module to obtain the code files in the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool component according to different code file lists; the control module saves the code files in the local code file library.

[0032] Before developing code, R&D personnel can start the management system to obtain updated content from the Artifactory server. Especially when building an R&D project environment, it is necessary to download the initial environment of the software development project, and download a lot of software code or dependency files. If all of them are manually screened on the web, it will take a lot of manpower. The file list crawler module in the automatic synchronization module can automatically obtain the file list and automatically download according to the list. Greatly improve work efficiency.

[0033] The above-mentioned warehouse code file list includes file name, file creation date, file size, and file MD5 check value; the code update check module checks the local code file library, and the local code file list includes file name, file creation date, file size, and file MD5 check value; the code update check module compares the warehouse code file list with the local code file list, and adds files in the local code file list that do not have the file name in the warehouse code file list to different code file lists; the code update check module compares the warehouse code file list with the local code file list, and adds files with the same file name, different MD5 check values ​​or different file sizes to different code file lists; when the control module crawls files with the same file name and different MD5 check values ​​according to different code file lists, it needs to obtain the operator's authorization.

[0034] For a project, different R&D personnel often update the same file. At this time, different versions will appear. Different versions have different matching relationships. Different files have different MD5 checksum values. When the automatic synchronization module finds such a file, it needs to obtain the operator's authorization before downloading it to overwrite the local file.

[0035] The above may also include a software development project, which includes the code of the local code file library. The software development project may compile and run and debug the code of the local code file library.

[0036] New code can be generated on the application computer, including a local software development engineering environment.

[0037] like Figure 3 The above also includes a file upload module; the control module drives the code update check module to check the local code file library to obtain the local code file list, and the code update check module compares the difference between the local code file list and the warehouse code file list to obtain the local new file list; the control module drives the file upload module according to the local new file list and uploads the files in the local new file list to the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool.

[0038] Locally developed software files, whether source code or target executable modules, can be automatically uploaded to the Artifactory server.

[0039] According to the management system for automatic synchronous download of code warehouse as described in claim 4, it is characterized in that the code update check module compares the warehouse code file list with the local code file list, and adds the files in the local code file list that are not in the warehouse code file list to the local new file list; the code update check module compares the warehouse code file list with the local code file list, and adds the files with the same file name, different MD5 checksum value, and the local file creation date later than the warehouse file creation date to the local new file list.

[0040] When uploading code, code that is not available on the Artifactory server can be automatically uploaded. For code or executable files with the same file name that appear on both the server and the local computer, it is necessary to check which file has a higher version. If the local file was created later, you can add it to the local new file list.

[0041] As mentioned above, when uploading the local new file list file to the code repository of the Artifactory server, the operator's authorization is required. The authorization includes but is not limited to specific password authentication and SMS verification code verification of the operator's identity.

[0042] When uploading code to the Artifactory server and transferring the operation design to other developers, you need to be cautious and verify the operator's permissions. The Artifactory server can also record the operator's operation process log for easy backtracking.

[0043] like Figure 4,A management method for automatic synchronization download of a code repository, comprising,

[0044] Step 10: Obtain the URL address of the Artifactory server from the application computer;

[0045] Step 20: In the Jenkins plug-in, the Jenkins component is called to drive the browser tool component to obtain the repository code file list in the code repository of the Artifactory server;

[0046] Step 30: The Jenkins plug-in obtains the local code file list, compares the local code file list with the warehouse code file list, and obtains the different code file list and the local new file list;

[0047] Step 40: The Jenkins plug-in downloads the code files in the Artifactory server to the local file library according to different code file lists;

[0048] Step 50: The Jenkins plug-in uploads the code files in the local file library to the Artifactory server based on the local new file list.

[0049] By using the jenkins plug-in, you can quickly develop software in the jenkins component environment and quickly implement management methods. Through the jenkins plug-in, you can automatically obtain web page files from the Artifactory server URL address. The plug-in calls the jar package program, enters the URL for crawling data, the jar package program crawls the Artifactory html web page data, Jsoup parses the html web page data, the jar package returns the crawled file name data to the jenkins plug-in, and the jenkins plug-in displays the file name list.

[0050] The above-mentioned warehouse code file list includes the file name, file creation date, file size, and the file's MD5 checksum; the local code file list includes the file name, file creation date, file size, and the file's MD5 checksum.

[0051] In the above step 30, the warehouse code file list is compared with the local code file list, and the files in the local code file list that do not have the file names in the warehouse code file list are added to the different code file lists; the warehouse code file list is compared with the local code file list, and the files with the same file name, different MD5 checksum values ​​or different file sizes are added to the different code file lists; in step 40, when downloading the code files in the Artifactory server to the local file library according to the different code file lists, the operator's authorization is required.

[0052] When downloading server files to the local computer, the local operator is usually affected. During verification, a simple password authentication and authorization can be performed for the operator.

[0053] In the above step 30, the warehouse code file list is compared with the local code file list, and the files in the local code file list that are not in the warehouse code file list are added to the local new file list; the warehouse code file list is compared with the local code file list, and the files with the same file name, different MD5 checksum values, and local file creation date later than the warehouse file creation date are added to the local new file list.

[0054] In the above step 50, when the local new file list file is uploaded to the code repository of the Artifactory server, the operator's authorization is required, and the authorization includes but is not limited to specific password authentication and SMS verification code verification of the operator's identity.

[0055] When uploading code or files to the Artifactory server, many members are affected, and the operator's permissions need to be strictly authenticated. At the same time, the operator needs to be repeatedly confirmed to prevent misoperation.

[0056] Although the present invention is illustrated and described according to the preferred embodiment and several alternatives, the invention is not limited by the specific description in this specification. Other additional replacement or equivalent components can also be used to practice the present invention.

Claims

1. A management system for automatic synchronization and downloading of code repositories, characterized in that: It includes Artifactory server and application computer. The application computer includes browser tool component, Jenkins component, automatic synchronization module and local code file library. The automatic synchronization module includes a file list crawler module, a file crawler module, a control module, a code update check module and a file upload module; The control module drives the file list crawler module to obtain the repository code file list in the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool component; The control module drives the code update check module to check the local code file library and obtain a local code file list. The code update check module compares the difference between the local code file list and the warehouse code file list to obtain a different code file list. The control module drives the file crawler module according to different code file lists, and drives the browser tool component to obtain the code files in the code repository of the Artifactory server by mobilizing the jenkins component; The control module saves the code file in the local code file library; wherein, when the code file in the Artifactory server is downloaded to the local file library according to different code file lists, the operator's authorization is required; The control module drives the code update check module to check the local code file library and obtain the local code file list. The code update check module compares the difference between the local code file list and the warehouse code file list to obtain the local new file list. The control module drives the file upload module according to the local new file list and uploads the files in the local new file list to the code repository of the Artifactory server by mobilizing the jenkins component to drive the browser tool; when the files in the local new file list are uploaded to the code repository of the Artifactory server, the operator's authorization is required.

2. The management system for automatic synchronization download of code warehouse according to claim 1 is characterized in that: The warehouse code file list includes the file name, file creation date, file size, and the file's MD5 checksum; The code update check module checks the local code file library. The local code file list includes the file name, file creation date, file size, and the file's MD5 checksum; The code update check module compares the warehouse code file list with the local code file list, and adds files in the local code file list that do not have the file names in the warehouse code file list to the different code file lists; The code update check module compares the repository code file list with the local code file list, and adds files with the same file name, different MD5 checksums or different file sizes to different code file lists; When the control module crawls files with the same file name and different MD5 checksum values ​​according to different code file lists, it needs to obtain the operator's authorization.

3. The code repository automatic synchronization download management system according to claim 1, characterized in that: It also includes software development projects, which include the code of the local code file library. The software development project can compile and run and debug the code of the local code file library.

4. The management system for automatic synchronization download of code warehouse according to claim 1, characterized in that: The code update check module compares the warehouse code file list with the local code file list, and adds the files in the local code file list that are not in the warehouse code file list to the local new file list; The code update check module compares the warehouse code file list with the local code file list, and adds files with the same file name, different MD5 checksum values, and local file creation date later than the warehouse file creation date to the local new file list.

5. The management system for automatic synchronization download of code warehouse according to claim 4 is characterized in that: When uploading the local new file list file to the code repository of the Artifactory server, the operator's authorization is required, including but not limited to specific password authentication and SMS verification code verification of the operator's identity.

6. A method for managing automatic synchronous downloading of a code repository, characterized in that: Step 10: Obtain the URL address of the Artifactory server from the application computer; Step 20: In the Jenkins plug-in, the Jenkins component is called to drive the browser tool component to obtain the repository code file list in the code repository of the Artifactory server; Step 30: The Jenkins plug-in obtains the local code file list, compares the local code file list with the warehouse code file list, and obtains the different code file list and the local new file list; Step 40: The Jenkins plug-in downloads the code files in the Artifactory server to the local file library according to different code file lists; Step 50: The Jenkins plug-in uploads the code files of the local file library to the Artifactory server according to the local new file list, where: In step 40, when downloading the code files in the Artifactory server to the local file library according to different code file lists, the operator's authorization is required; In step 50, when the local new file list file is uploaded to the code repository of the Artifactory server, the operator's authorization is required.

7. The method for managing automatic synchronous downloading of a code repository according to claim 6, characterized in that: The warehouse code file list includes the file name, file creation date, file size, and the file's MD5 checksum; The local code file list includes the file name, file creation date, file size, and the file's MD5 checksum.

8. The method for managing automatic synchronous downloading of a code repository according to claim 7, characterized in that: In step 30, the warehouse code file list is compared with the local code file list, and the files whose file names are not in the warehouse code file list in the local code file list are added to the different code file list; Compare the repository code file list with the local code file list, and add files with the same file name, different MD5 checksums, or different file sizes to different code file lists.

9. The method for managing automatic synchronous downloading of a code repository according to claim 7, characterized in that: In step 30, the warehouse code file list is compared with the local code file list, and the files in the local code file list that are not in the warehouse code file list are added to the local new file list; Compare the warehouse code file list with the local code file list, and add files with the same file name, different MD5 checksum values, and local file creation date later than the warehouse file creation date to the local new file list; in step 50, when the files in the local new file list are uploaded to the code repository of the Artifactory server, the operator's authorization needs to be obtained, including but not limited to specific password authentication and SMS verification code verification of the operator's identity.