A code package automatic publishing system
Through the automatic code package release system, automatic compilation, packaging and release are solved, and the problem of low efficiency in software product release stage is improved, and work efficiency and installation package accuracy are improved.
Patent Information
- Application Number
- CN202310232048.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2043-03-09
AI Technical Summary
In the prior art, the management efficiency of software products from development to release is low, and requires human operation to be compiled, packaged and released, resulting in low efficiency.
Provides a code package automatic release system, including creating modules, deploying modules, pre-release check modules and release modules, and reduces manual intervention through automated compilation, packaging and release.
It improves the work efficiency of the release stage, reduces the time of manual operation, ensures the accuracy and security of the installation package, and improves the flexibility of the system.
Smart Images

Figure CN116243929B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a system for automatically publishing code packages. Background Art
[0002] At present, with the continuous iteration and update of software products, their technical details and module design are becoming more and more complex. Software companies have higher and higher management requirements for products from the development stage to the release stage.
[0003] In the prior art, after the product development phase is completed, it is usually necessary to manually perform pre-release operations on the developed code, which makes the work efficiency of the release phase low. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a code package automatic publishing system for automatically compiling, packaging and publishing programs, thereby improving the work efficiency of the publishing stage.
[0005] An embodiment of the present application provides a code package automatic publishing system, which includes: a creation module, a deployment module, a pre-release check module and a release module; wherein the creation module is used to obtain the initial code corresponding to the project according to the creation request of the target user; wherein the initial code is the code that is pre-developed based on the standard code; the deployment module is used to deploy the initial code to a preset environment for compilation and packaging, and generate an installation package corresponding to the initial code; the pre-release check module is used to check the version information corresponding to the installation package; and the release module is used to release the installation package checked by the pre-release check module.
[0006] The embodiment of the present application uses a deployment module to automatically compile and package the code to be packaged, and automatically publishes the obtained installation package through a publishing module, so that after the developer develops the code, the system can perform automatic compilation, packaging and publishing operations, thereby improving the work efficiency of the publishing stage.
[0007] In some embodiments, the initial code includes an initial standard code and an initial derivative code; the system also includes a code merging module; used to replace the initial standard code with the latest version of the standard code, and merge it with the initial derivative code to obtain an updated code; accordingly, the deployment module is used to deploy the updated code to a preset environment for compilation and packaging, and generate an installation package corresponding to the updated code.
[0008] The embodiment of the present application updates the standard code part in the obtained initial code to the latest version of the standard code through the code merging module, so that the standard code part in the obtained initial code can always maintain the optimal performance, thereby improving the quality of the code.
[0009] In some embodiments, the deployment module includes an upgrade module for recompiling and packaging the repaired initial code to generate a corresponding installation package.
[0010] The embodiment of the present application uses the upgrade module in the deployment module to recompile and package the repaired code, so that for the code of the same project, it only needs to be deployed once on the system, and the code that has been tested and modified can be directly upgraded to complete the automatic compilation, packaging and other operations, which reduces the time for redeployment and improves the work efficiency of the release stage. In addition, the upgrade operation ensures that the final released installation package is an installation package that does not have bugs or the existing bugs have little impact on the overall operation of the code, that is, the accuracy and security of the released installation package are guaranteed.
[0011] In some embodiments, the deployment module includes a task queue, which is used to store tasks to be deployed; the deployment module processes the tasks to be deployed in the task queue in parallel by utilizing idle threads in a thread pool.
[0012] The embodiment of the present application adds a task queue in the deployment module so that after multiple projects are created, multiple projects can be processed in parallel, thereby improving the flexibility of system use, reducing waiting time, and improving work efficiency in the release phase.
[0013] In some embodiments, the publishing module includes an installation package publishing module, which is used to generate a download address corresponding to the installation package so that the target user can access it according to the download address.
[0014] The embodiment of the present application publishes the software in the form of an installation package, so that after obtaining the automatically generated installation package, the software can be published directly by downloading the installation package. In addition, the publishing environment suitable for the installation package can be directly published, which speeds up the publishing efficiency.
[0015] In some embodiments, the publishing module includes an image publishing module for creating an image file corresponding to the installation package and generating a pull command for the image file so that the target user can access it according to the pull command.
[0016] The embodiment of the present application publishes the publishing method in a mirroring manner, so that when dealing with different publishing environments, an appropriate publishing method can be flexibly selected, thereby improving the flexibility of system use.
[0017] In some embodiments, the pre-release check module includes a splicing module for splicing the process number of the installation package with a preset URL to generate a corresponding access address; accordingly, the pre-release check module checks the version information corresponding to the installation package through the access address.
[0018] The embodiment of the present application obtains the access address of the project installation package through the splicing module, so that the version information of the installation package can be viewed through the access address. Thus, the specific information of the project installation package can be quickly obtained, laying a foundation for subsequent release work.
[0019] In some embodiments, the creation module includes a push module for pushing the initial code to a remote code repository for storage.
[0020] The embodiment of the present application pushes the initial code to the code repository for storage through the push module, which facilitates subsequent code search, modification, and redevelopment.
[0021] In some embodiments, the system also includes a code comparison module for comparing the current version code with the base version code and displaying the comparison result; wherein the current version code is a code developed based on the base version code.
[0022] The embodiment of the present application obtains the difference between the current version of the code and the previous version of the code through a comparison module. After each iteration of the code, the updated location can be known, and the code changes can be quickly obtained, so that the overall situation of the code can be grasped.
[0023] In some embodiments, the system further includes an external calling module for calling a code management tool and a process management tool.
[0024] The embodiment of the present application calls external tools through a calling module, so that the system can be effectively connected with the external tools, so that the external tools can be directly used to implement corresponding functions, reducing the complexity of system development.
[0025] Other features and advantages of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A schematic diagram of a code package automatic publishing system provided in an embodiment of the present application;
[0028] Figure 2 A schematic diagram of a creation request provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application are only for the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale.
[0030] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0031] It should be noted that all technical and scientific terms used in this document have the same meanings as those generally understood by technicians in the technical field to which this application belongs; the terms used in this document are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0032] In the description of the embodiments of the present application, “plurality” means more than two, unless otherwise clearly and specifically defined.
[0033] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0034] Before describing the code package automatic publishing system provided by the present application, a brief description of the application scenario of the system is first given to facilitate the understanding of the solution proposed in the present application.
[0035] Usually, different customers have different needs. If it is a very time-consuming and labor-intensive project to develop products for different customers, code from 0 to 1. Therefore, it is necessary to improve the efficiency of the development stage. Although different customers have different needs, the main functions of software products of the same type or with little difference will not be too different. Therefore, based on this discovery, this application standardizes the development of common functions of a certain type of product to obtain standard codes. And for different needs of customers, customized development is carried out on the basis of standard codes to obtain the customized code of the customer, thereby saving material, manpower, financial resources and time.
[0036] At the same time, as customer needs continue to increase, if manual compilation and packaging are performed every time the code is developed, it will be a time-consuming and labor-intensive project. Therefore, this application provides a code package automatic publishing system to facilitate the automatic deployment, upgrade, compilation, packaging and publishing of the developed code, thereby reducing the manual workload and improving the processing efficiency of the publishing stage.
[0037] Figure 1 A schematic diagram of a code package automatic publishing system provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the code package automatic publishing system (referred to as: system) 10 includes a creation module 101, a deployment module 102, a pre-publishing check module 103 and a publishing module 104, wherein:
[0038] The creation module 101 is used to obtain the initial code corresponding to the project according to the creation request of the target user; wherein the initial code is the code that is pre-developed based on the standard code; the deployment module 102 is used to deploy the initial code to a preset environment for compilation and packaging, and generate an installation package corresponding to the initial code; the pre-release check module 103 is used to check the version information corresponding to the installation package; the release module 104 is used to release the installation package checked by the pre-release check module.
[0039] In the specific implementation process, the target user can be a developer, a tester, or a company or individual with project requirements. It should be noted that even if the target user is a developer or a tester, the project is created according to the customer's needs. The project is created to obtain a creation request, where the creation request refers to what kind of object needs to be created.
[0040] The creation module 101 includes a front-end input function and a back-end processing function. The front-end input is that the target user fills in the object and information to be created by filling in a form. The back-end is implemented to process the information input by the front-end and display the result in the front-end interface. It should be noted that the creation module can support multiple users to fill in or submit information at the same time, thereby creating different branches, and developers perform corresponding code development according to different branch information.
[0041] Figure 2 A schematic diagram of a creation request provided in an embodiment of the present application, such as Figure 2 As shown, the form content of the project creation includes the input of project name, project key, whether it is domestic development, company name, project version, basic branch and other information. Among them, localization refers to the corresponding customized adjustment and adaptation during customized development based on the version information of the customer's domestic operating system and domestic middleware. When creating a project, the system will automatically select the test environment and middleware corresponding to the customer based on the field of whether it is domestic development.
[0042] After filling in and submitting the information in the form in sequence, the system background will process according to the received creation request. The processing process is as follows: the creation module calls the Jgit class library to generate commands for updating and pulling the latest standard code, commands for creating custom code based on the standard code, and commands for pushing the created custom code to the remote warehouse, and then uses the git program to create branches, so that developers can perform customized development based on the standard code and obtain the initial code. After obtaining the initial code, push the initial code back to the code warehouse for storage, so that it can be directly pulled during the next iterative development. It should be noted that in actual applications, the style of the form and the content contained therein can be adjusted according to actual conditions, and this application does not make specific restrictions on this.
[0043] The initial code can also be called customized code, that is, the code created according to the actual needs of different customers. The initial code is the code that is pre-developed based on the standard code. Standard code refers to the code that meets the general needs of most customers. The standard code can be generated in advance and stored in the code repository. When customized development is required according to the customer, the standard code is pulled from the code repository, and customized development is performed on the basis of the standard code to obtain the corresponding initial code. It should be noted that the code repository can be GitLab, GitHub and other code management tools. The code management tool can be selected and determined according to the actual situation, and this application does not make specific restrictions on this.
[0044] After the creation module 101 obtains the initial code, it means that the development phase of the project has been completed. At this time, the deployment module 102 needs to be used to deploy the developed initial code to the preset environment so that the final installation package can also work normally in the target environment.
[0045] It should be noted that, since the developers created development branches and release branches when developing the project, the development branch is used to continuously iterate the development needs of the target users, and the release branch is used to merge the target users' phased needs after development is completed. Therefore, deploying the initial code to the preset environment can be deployed to a pre-set development environment, or it can be deployed to a pre-set release environment. It should be known that when the preset environment is set to the development environment, it indicates that the initial code is only the code for some functions, and it is still necessary to perform continuous iterative updates. Therefore, the development environment does not have a release function. When the preset environment is set to the release environment, it indicates that the initial code has met the current needs of the target users, and deployment testing can be performed to obtain the installation package. Therefore, the release environment has a release function. In actual applications, the deployment environment is selected specifically according to the actual situation, and this application does not specifically limit this.
[0046] The target environment refers to an environment that is similar to the actual operating environment of the customer's project, so as to ensure that when the project is delivered to the customer, the project can run in the customer's actual environment.
[0047] After the project deployment is completed, the pre-release inspection module 103 needs to perform a pre-release inspection operation on the generated installation package to ensure that the released installation package is correct. Finally, the release module 104 releases the correct installation package after the inspection.
[0048] The embodiment of the present application uses a deployment module to automatically compile and package the code to be packaged, and automatically publishes the obtained installation package through a publishing module, so that after the developer develops the code, the system can perform automatic compilation, packaging and publishing operations, thereby improving the work efficiency of the publishing stage.
[0049] In some embodiments, the initial code includes an initial standard code and an initial derivative code; the system also includes a code merging module, which is used to replace the initial standard code with the latest version of the standard code, and merge it with the initial derivative code to obtain an updated code; accordingly, the deployment module is used to deploy the updated code to a preset environment for compilation and packaging, and generate an installation package corresponding to the updated code.
[0050] In the specific implementation process, the initial standard code is the code written according to the general needs of the target user. The initial standard code is pre-written by the developer according to the general needs and stored. When customized development is required, it can be directly used. The initial derivative code is the code for additional requirements written on the basis of the standard code according to the creation request of the target user.
[0051] It should be noted that as the demand continues to increase, the requirements are getting higher and higher, so it is necessary to iteratively update the standard code to ensure that the standard code used in the next customized development is the latest standard code to improve the performance of the code. Among them, the standard code includes the initial standard code, which is the standard code based on the current customized development.
[0052] In order to facilitate understanding of the meaning and difference between the initial standard code, the initial derivative code and the latest version of the standard code, we take the project that implements the login function as an example. For example, when implementing the login function, it is generally possible to log in by entering the account and password, that is, the code that implements the account and password input is the initial standard code, but some companies require that after entering the password, a dynamic verification code is also required to complete the login in order to ensure the security of the login. At this time, the code that implements the dynamic verification code can be regarded as the initial derivative code that is customized and developed according to the actual needs of the customer.
[0053] Since the standard code is constantly updated, it is possible that after the customized development is completed according to the actual needs of the customer, the standard code has also completed the latest iteration update. At this time, the code that has completed the latest iteration update is called the latest standard code. Therefore, it is necessary to replace the initial standard code with the latest version of the standard code, and then merge it with the initial derivative code to obtain the updated code, so as to ensure that the performance of the final code is better.
[0054] It should be noted that when iteratively updating the standard code, iterative updates can be performed once a month, once every two months, etc. In addition, the iterative update of the standard code can be to update the performance part of the standard code, or to merge newly discovered common functions into the standard code, etc. The specific method of iteratively updating the standard code can be selected and determined according to the actual situation, and this application does not make specific restrictions on this. For the iterative update of the performance part, it can be to improve the response speed, reduce the frequency of freezing, or improve security, etc.
[0055] Finally, during the deployment phase, the updated code is deployed to the preset environment for compilation and packaging to obtain the installation package corresponding to the updated code.
[0056] It should be noted that when merging codes, after obtaining the initial code, the initial standard code can be replaced with the latest version of the standard code and then merged with the initial derivative code; it can also be that the initial standard code is replaced with the latest version of the standard code before customized development is carried out according to the initial standard code, and then the initial derivative code is developed on the basis of the latest version of the standard code to complete the merger; it can also be that the initial standard code is replaced with the latest version of the standard code during the customized development process, and then the latest version of the standard code is merged with the initial derivative code; it can also be that after the initial code test is completed and before the release, the initial standard code is replaced with the latest version of the standard code and then merged with the initial derivative code. Therefore, the time node for code merging can be selected according to the actual situation, and this application does not make specific restrictions on this.
[0057] The embodiment of the present application updates the standard code part in the obtained initial code to the latest version of the standard code through the code merging module, so that the standard code part in the obtained initial code can always maintain the optimal performance, thereby improving the quality of the code.
[0058] In some embodiments, the deployment module includes an upgrade module for recompiling and packaging the repaired initial code to generate a corresponding installation package.
[0059] In the specific implementation process, when the project is first developed, it needs to be deployed to the test environment for various types of tests. Usually, it is difficult for the first developed program to pass the test in one go, so the code needs to be upgraded after being repaired according to the test results, so the repaired initial code needs to be compiled and packaged to generate the corresponding installation package.
[0060] The embodiment of the present application uses the upgrade module in the deployment module to recompile and package the repaired code, so that for the code of the same project, it only needs to be deployed once on the system, and the code that has been tested and modified can be directly upgraded to complete the automatic compilation, packaging and other operations, which reduces the time for redeployment and improves the work efficiency of the release stage. In addition, the upgrade operation ensures that the final released installation package is an installation package that does not have bugs or the existing bugs have little impact on the overall operation of the code, that is, the accuracy and security of the released installation package are guaranteed.
[0061] In some embodiments, the deployment module includes a task queue, which is used to store tasks to be deployed; the deployment module processes the tasks to be deployed in the task queue in parallel by utilizing idle threads in a thread pool.
[0062] In the specific implementation process, the system supports multiple projects to submit deployment or upgrade operations at the same time by using idle threads in the thread pool. The task queue is used to store deployment tasks, where the calling logic of the task queue is as follows:
[0063] (1) Projects of normal priority will be arranged according to the logic of first initiated, first scheduled.
[0064] (2) For projects with higher priority or that need to be dispatched urgently, the administrator can perform a "priority" operation and place the task at the head of the queue.
[0065] (3) For items that no longer need to be queued, the administrator can perform a "remove" operation to remove the task from the queue.
[0066] The embodiment of the present application adds a task queue in the deployment module so that after multiple projects are created, multiple projects can be processed in parallel, thereby improving the flexibility of system use, reducing waiting time, and improving work efficiency in the release phase.
[0067] In some embodiments, the publishing module includes an installation package publishing module, which is used to generate a download address corresponding to the installation package so that the target user can access it according to the download address.
[0068] In the specific implementation process, the installation package publishing module can also be called the compressed package publishing module.
[0069] Different publishing tasks are driven according to the publishing type. For example, when the target user deploys the installation package using the traditional server deployment method, such as when the target user creates a server with Linux or Windows operating system and directly deploys on this server, it is necessary to use the installation package method for publishing. When publishing in the installation package method, the specific publishing process is as follows:
[0070] (1) The code package automatic publishing system informs the continuous integration tool through the HTTP protocol to download the compiled installation package of a certain project.
[0071] (2) After the continuous integration tool downloads the installation package, it pushes the installation package to the storage system through a pre-configured Python script.
[0072] (3) After the push is successful, the download address of the installation package is generated and displayed to the target user.
[0073] The target user can access or download the installation package according to the download address, and then perform operations such as decompression and installation.
[0074] It should be noted that the continuous integration tool can be Bamboo, or Jenkins, etc., and the storage system can be Huawei Cloud Object Storage Service (OBS), or Alibaba Cloud Object Storage Service (OSS), etc. Therefore, the selection of continuous integration tools and storage systems can be determined according to actual conditions, and this application does not make specific limitations on this.
[0075] The embodiment of the present application publishes the software in the form of an installation package, so that after obtaining the automatically generated installation package, the software can be published directly by downloading the installation package. In addition, the publishing environment suitable for the installation package can be directly published, which speeds up the publishing efficiency.
[0076] In some embodiments, the publishing module includes an image publishing module for creating an image file corresponding to the installation package and generating a pull command for the image file so that the target user can access it according to the pull command.
[0077] In the specific implementation process, different release tasks are driven according to the release type. For example, when the target user uses a containerized environment to deploy the installation package, it is necessary to use the image method for release. The containerized environment usually refers to Docker, Kubernetes, etc. When the image method is used and the containerized environment is Docker, the specific release process is as follows:
[0078] (1) The code package automatic publishing system informs the continuous integration tool through the HTTP protocol to download the compiled installation package of a certain project.
[0079] (2) After the continuous integration tool downloads the installation package, it first decompresses it, creates a file based on the pre-compiled image, and runs the docker build command to create the image file corresponding to the installation package.
[0080] (3) The continuous integration tool pushes the created image file to the image management repository through a pre-configured Python script.
[0081] (4) After the push is successful, a pull command for the image is generated and displayed to the target user.
[0082] The target user can access or download the image file according to the image pull command, and then perform operations such as decompression and installation.
[0083] It should be noted that the selection of continuous integration tools can refer to the above embodiments, which will not be repeated here. In addition, the image management warehouse can be Huawei Cloud Container Image Service (SoftWare Repository for Container, SWR), Alibaba Cloud Container Registry (ACR), or self-built open source image management warehouse Habor, etc. The specific selection can be made according to the actual situation, and this application does not make specific restrictions on this.
[0084] The embodiment of the present application publishes the publishing method in a mirroring manner, so that when dealing with different publishing environments, an appropriate publishing method can be flexibly selected, thereby improving the flexibility of system use.
[0085] In some embodiments, the pre-release check module includes a splicing module for splicing the process number of the installation package with a preset URL to generate a corresponding access address; accordingly, the pre-release check module checks the version information corresponding to the installation package through the access address.
[0086] In the specific implementation process, each installation package corresponds to an introduction information, through which the project, iterative version, process number, etc. corresponding to the installation package can be learned.
[0087] Since the process number can uniquely identify the installation package, after the splicing module obtains the process number of an installation package, it splices the process number with the preset URL to generate an access address of the installation package, which is used by the target user to check the information of the installation package through the access address.
[0088] It should be noted that the preset URL is a pre-set URL. For example, when using JIRA software for process management, the software is a website system, and its access address (URL) is https: / / jira.xxxx.com / browse.
[0089] When it is necessary to check the installation package with the process number DEV-111, the process number DEV-111 of the installation package is obtained, and it is concatenated with the URL of the JIRA software to obtain the access address https: / / jira.xxxx.com / browse / DEV-111.
[0090] The embodiment of the present application obtains the access address of the project installation package through the splicing module, so that the version information of the installation package can be viewed through the access address. Thus, the specific information of the project installation package can be quickly obtained, laying a foundation for subsequent release work.
[0091] In some embodiments, the creation module includes a push module for pushing the initial code to a remote code repository for storage.
[0092] In the specific implementation process, the code repository is used to store the initial code after each development. The selection of the code repository can be found in the above embodiment and will not be repeated here.
[0093] The embodiment of the present application pushes the initial code to the code repository for storage through the push module, which facilitates subsequent code search, modification, and redevelopment.
[0094] In some embodiments, the system also includes a code comparison module for comparing the current version code with the base version code and displaying the comparison result; wherein the current version code is a code developed based on the base version code.
[0095] In the specific implementation process, the current version code refers to the latest developed code, and the basic version code is the previous version code of the current version code, that is, the current version code is the code developed based on the basic version code. The current version code and the basic version code can both be customized codes, or both can be standard codes, or the current version code can be customized code and the basic version code can be standard code, etc.
[0096] In the implementation of the comparison module, the specific information of the current version code and the specific information of the basic version code can be directly presented in the front-end interface for comparison; or the access addresses of the current version code and the basic version code can be presented in the front-end interface in the form of a list, so that by clicking on the access address, the specific information can be obtained, thereby obtaining the difference between the two. The specific implementation can be set according to the actual situation, and this application does not make specific limitations on this.
[0097] The embodiment of the present application obtains the difference between the current version of the code and the previous version of the code through a comparison module. After each iteration of the code, the updated location can be known, and the code changes can be quickly obtained, so that the overall situation of the code can be grasped.
[0098] In some embodiments, the system further includes an external calling module for calling a code management tool and a process management tool.
[0099] In the specific implementation process, the code management tool and the process management tool are called through the external call module. The code management tool is used to manage the developed code, such as storing the code, recording code modifications, etc. The process management tool can also be called a project management tool, which is used to manage project planning, task allocation, demand management, error tracking, etc. Among them, the code management tool can be Gitlab, GitHub, etc., and the process management tool can be Jira, a third-party process management tool, etc. Which code management tool or process management tool to use can be selected according to the actual situation, and this application does not make specific restrictions on this.
[0100] The embodiment of the present application calls external tools through a calling module, so that the system can be effectively connected with the external tools, so that the external tools can be directly used to implement corresponding functions, reducing the complexity of system development.
[0101] In some embodiments, the technology selection involved in developing the code package automatic publishing system includes:
[0102] (1) Development mode: front-end and back-end separation development mode.
[0103] (2) Proxy layer selection: Nginx.
[0104] (3) Front-end selection: React, Node.
[0105] (4) Backend selection: Java, Shell, Python.
[0106] (5) Remote Procedure Call Protocol (RPC) technology selection: Dubbo.
[0107] (6) Continuous integration tool: Bamboo.
[0108] (7) Virtualization solution: VMware.
[0109] (8) Code version management: Git.
[0110] (9) Process management system: Jira.
[0111] (10) Storage system: OBS object storage, SWR Huawei Cloud container image repository.
[0112] In some embodiments, the operation unit uses "project" as the smallest operation unit to explain the specific functions of the code package automatic publishing system developed using the above-mentioned technical selection, wherein each project has specific codes and processes.
[0113] Project creation: The system backend pulls the corresponding standard version code through the JGit component according to the creation request of the target user. After pulling, the customer's branch is created based on the standard version code. The specific creation process is: the system generates a command for branch creation through the JGit class library, and gives the command to the git program to execute, thereby completing the creation of the branch. Push the created code to the remote code repository. It should be noted that in code development, the front-end and back-end are usually developed separately. Therefore, if the customer has multiple code repositories, such as: front-end code repository, back-end code repository, mobile code repository, etc., the push process will be executed multiple times in a loop until all types of code are pushed to the corresponding repository. Among them, the push process is transparent to the operating user.
[0114] Project deployment: After the code is created, it needs to be deployed to the test environment. When the background service receives the "deployment" information, it will send the compilation commands of multiple code modules to the compilation tool Bamboo through the http protocol for concurrent compilation. After the deployment is successful, the driver packaging task downloads the compilation results of each code module and packages them into an installation package. Finally, the driver executes the task and pushes the installation package to the test machine for decompression, upgrade, and startup.
[0115] It should be noted that after the test machine decompresses the installation package and tests it, bugs are usually found. At this time, the developer will fix the code based on the bug information to obtain the fixed project code. After the project code is updated, it needs to be recompiled and packaged, so it is necessary to "upgrade" and recompile the latest code and publish it to the test environment for testers to verify again.
[0116] Project code merging: If the latest version of the standard code exists, when the backend service receives a merge request, it will pull the project code to the workspace through the JGit library, and merge the latest version of the standard code through the merge command. If the merge is successful, it will be pushed to the code repository for storage. If there is a conflict in the merge process, the conflict information will be recorded and marked to facilitate subsequent elimination of the conflict.
[0117] Check before project release: After receiving the request, the backend service analyzes the GIT submission information, extracts the process number in the information, splices the URL, performs the demand process query, and displays the result. Please refer to the above embodiment for the splicing process, which will not be repeated here.
[0118] Project release: After receiving the request, the backend service will drive different release tasks according to the release type, including installation package release mode and image release mode. The specific process of installation package release mode and image release mode can be found in the above embodiment, which will not be repeated here.
[0119] After the release is successful, a release record will be generated for page display and download by relevant deployment personnel.
[0120] In summary, the beneficial effects of this system are:
[0121] (1) The system integrates code version management tools and compilation scheduling tools for development, providing automated compilation, packaging, and publishing functions.
[0122] (2) It provides a WYSIWYG process operation interface for developers, testers, and publishers, allowing them to drive automated processes without requiring any technical expertise.
[0123] (3) Integrate code management tools and process management tools to exchange data and provide a visual interface to display the processes corresponding to new features and problem fixes in each release version for business personnel to review and confirm the release content.
[0124] (4) Provides automatic branch code merging function to reduce the labor cost and unsafe factors of code merging and improve release efficiency.
[0125] In the embodiments provided in the present application, it should be understood that the disclosed system can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0126] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0128] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A code package automatic publishing system, characterized in that: The system includes: a creation module, a deployment module, a pre-release check module and a release module; wherein, The creation module is used to obtain the initial code corresponding to the project according to the creation request of the target user; wherein the initial code is a code that is redeveloped based on the standard code in advance; The deployment module is used to deploy the initial code to a preset environment for compilation and packaging, and generate an installation package corresponding to the initial code; The pre-release check module is used to check the version information corresponding to the installation package; The publishing module is used to publish the installation package checked by the pre-publishing checking module; The deployment module includes an upgrade module, which is used to compile and package the repaired initial code again to generate a corresponding installation package; The pre-release inspection module includes a splicing module, which is used to splice the process number of the installation package with the preset URL to generate a corresponding access address; Correspondingly, the pre-release checking module checks the version information corresponding to the installation package through the access address; The initial code includes an initial standard code and an initial derivative code; the system further includes a code merging module, which is used to replace the initial standard code with the latest version of the standard code and merge it with the initial derivative code to obtain an updated code; the initial standard code is a code written according to the general needs of the target user, and the initial derivative code is a code written on the basis of the standard code according to the creation request of the target user; the latest version of the standard code is a standard code with updated performance or a standard code containing new general functions; Correspondingly, the deployment module is used to deploy the update code to a preset environment for compilation and packaging, and generate an installation package corresponding to the update code; The system also includes an external calling module for calling a code management tool and a process management tool.
2. The system according to claim 1, characterized in that The deployment module includes a task queue, and the task queue is used to store tasks to be deployed; The deployment module processes the tasks to be deployed in the task queue in parallel by utilizing the idle threads in the thread pool.
3. The system according to claim 1, characterized in that The publishing module includes an installation package publishing module, which is used to generate a download address corresponding to the installation package so that the target user can access it according to the download address.
4. The system according to claim 1, characterized in that The publishing module includes a mirror publishing module, which is used to create a mirror file corresponding to the installation package and generate a pull command for the mirror file so that the target user can access it according to the pull command.
5. The system according to claim 1, characterized in that The creation module includes a push module, which is used to push the initial code to a remote code repository for storage.
6. The system according to claim 5, characterized in that The system also includes a code comparison module, which is used to compare the current version code with the basic version code and display the comparison result; wherein the current version code is a code developed based on the basic version code.
Citation Information
Patent Citations
Hybrid application generation method and device
CN115640005A