A pipeline-based automated deployment method and apparatus

By adopting a pipeline-based automated deployment method, the problem of low deployment efficiency of large-scale system service programs is solved, achieving efficient and automated service program deployment and reducing costs.

CN116185445BActive Publication Date: 2026-01-30SHENZHEN COMTOP INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211726785.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-01-30
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

The deployment efficiency of large-scale system service programs in existing technologies is low and the cost is high. Existing CI/CD tools and manual deployment methods lack automation.

Method used

An automated deployment method based on pipelines is adopted. The target code is obtained from the code repository, a service deployment package is generated and the target image is pushed. The TSF platform's API is used for rolling updates to generate the target release package after iterative updates.

Benefits of technology

It improves the deployment efficiency of service programs, reduces deployment costs, decreases the utilization of processing resources, and enhances the degree of automation in deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116185445B_ABST
    Figure CN116185445B_ABST
Patent Text Reader

Abstract

This invention discloses an automated deployment method and apparatus based on a pipeline. The method includes: obtaining the target code corresponding to the service program to be deployed from a code repository; processing the target code according to a pre-written script to generate a service deployment package; processing the service deployment package according to the pre-written script to generate a target image and pushing the target image; and performing rolling updates on the pushed target image according to the pre-written script and the API of the TSF platform to generate a target release package. The target release package includes the iteratively updated service program. Implementing this invention enables the processing of the target code corresponding to the service program that needs to be updated according to a pre-written script, generating a target image, and calling the TSF API interface to perform rolling updates on the image to obtain the target release package, which is beneficial for improving the deployment efficiency of service programs and reducing deployment costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software data management technology, and in particular to an automated deployment method and apparatus based on a pipeline. Background Technology

[0002] Modern large-scale systems often consist of hundreds or even thousands of service programs. Faced with these services requiring rapid delivery, each service needs personalized processing from development to final deployment to meet specific business needs. However, current project delivery typically employs conventional CI / CD tools combined with manual deployment, which suffers from low deployment efficiency and insufficient automation. This invention provides a pipeline-based automated deployment method and apparatus to automate the deployment of service programs, thereby addressing the problems of low deployment efficiency and high deployment costs in existing technologies. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide an automated deployment method and apparatus based on pipeline, which can effectively improve the deployment efficiency and communication efficiency of service programs.

[0004] To address the aforementioned technical problems, the first aspect of this invention discloses an automated deployment method based on a pipeline framework, the method comprising:

[0005] Obtain the target code corresponding to the service program to be deployed from the code repository;

[0006] The target code is processed according to a pre-written script to generate a service deployment package;

[0007] The service deployment package is processed according to the pre-written script, a target image is generated, and the target image is pushed.

[0008] The target image is continuously updated based on the pre-written script and the API of the TSF platform to generate a target release package, which includes the iteratively updated service program.

[0009] In one optional implementation, in the first aspect of the present invention, the pipeline is a workflow framework, the pre-written script is a shell script called in the pipeline environment, and the pre-written script includes multiple sub-scripts.

[0010] The step of obtaining the target code corresponding to the service to be deployed in the code repository includes:

[0011] Download the target code corresponding to the service to be deployed according to the pre-written script;

[0012] The target code was obtained using the JENKINS SCM plugin;

[0013] JENKINS is a continuous integration tool.

[0014] As an optional implementation, in the first aspect of the present invention, processing the target code according to a pre-written script to generate a service deployment package includes:

[0015] The pre-written script parses the preset first configuration file in the target code to obtain the service module to be iteratively updated.

[0016] The code corresponding to the service module is compiled according to the pre-written script to obtain the updated service module;

[0017] Modify the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program;

[0018] Based on the current service program deployment package, the second configuration file, and the updated service module, an updated service deployment package is generated.

[0019] The second configuration file includes at least one of the following: a database configuration file and a Consul address file;

[0020] After modifying the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the method further includes:

[0021] The third configuration file corresponding to the service script that needs to be iteratively updated is parsed, and the location of the service script is found based on the third configuration file;

[0022] Download the service script and update the service script according to the third configuration file;

[0023] The service scripts include SQL statement scripts.

[0024] As an optional implementation, in the first aspect of the present invention, the step of processing the service deployment package according to the pre-written script, generating a target image, and pushing the target image includes:

[0025] The service deployment package is processed according to the pre-written script and the service identifier of the service program to generate the target image and push the image to the API of the TSF platform;

[0026] The step of performing rolling updates on the target image after push according to the pre-written script and the API of the TSF platform to generate a target release package includes:

[0027] The API interface provided by the TSF platform is invoked based on the pre-written script and the service identifier of the service program;

[0028] The target image is continuously updated after being pushed through the CURL command and API parameters in the API interface;

[0029] The TSF platform is a third-party microservice platform.

[0030] The method further includes:

[0031] The target release package is stored in the version backup repository according to the pre-written script.

[0032] As an optional implementation, in a first aspect of the invention, after storing the target release package in a version backup repository according to the pre-written script, the method further includes:

[0033] Determine whether the version of the target release package needs to be rolled back;

[0034] When it is determined that the target release package needs to be rolled back, the rollback version corresponding to the target release package is obtained through the string param provided by JENKINS;

[0035] Select the service module that needs to be rolled back based on the rollback version;

[0036] The JENKINS version is read according to the pre-written script, and the target release package is updated according to the JENKINS version and the service module that needs to be rolled back, generating an updated target release package.

[0037] The updated target release package is processed according to the pre-written script, a second target image is generated, and the second target image is pushed.

[0038] As an optional implementation, in the first aspect of the present invention, before obtaining the target code corresponding to the service program to be deployed in the code repository, the method further includes:

[0039] Determine if the service program needs to be rolled back to a previous version;

[0040] When it is determined that the service program needs to be rolled back, the corresponding rollback version backup is retrieved from the version backup repository, and the release package of the corresponding version of the service program is regenerated based on the code of the rollback version backup.

[0041] When it is determined that the service program does not need to be rolled back, the operation of retrieving the target code corresponding to the service program to be deployed from the code repository is re-executed.

[0042] As an optional implementation, in the first aspect of the present invention, after modifying the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the method further includes:

[0043] The pre-written script is used to parse the preset first configuration file in the target code to obtain the service script that needs to be iteratively updated.

[0044] The code corresponding to the service script is updated according to the pre-written script to obtain the updated service script.

[0045] A second aspect of the present invention discloses an automated deployment device based on a pipeline, the device comprising:

[0046] The acquisition module is used to retrieve the target code corresponding to the service program to be deployed from the code repository;

[0047] The processing module is used to process the target code obtained by the acquisition module according to the pre-written script, and generate a service deployment package;

[0048] The processing module is also used to process the service deployment package according to the pre-written script, generate the target image, and push the target image;

[0049] The update module is used to perform rolling updates on the target image pushed by the processing module according to the pre-written script and the API of the TSF platform, and generate a target release package, the target release package including the iteratively updated service program.

[0050] As an optional implementation, in a second aspect of the present invention, the pipeline is a workflow framework, the pre-written script is a shell script called in the pipeline environment, and the pre-written script includes multiple sub-scripts.

[0051] The specific method by which the acquisition module obtains the target code corresponding to the service to be deployed in the code repository is as follows:

[0052] Download the target code corresponding to the service to be deployed according to the pre-written script;

[0053] The target code was obtained using the JENKINS SCM plugin;

[0054] JENKINS is a continuous integration tool.

[0055] As an optional implementation, in the second aspect of the present invention, the processing module processes the target code according to a pre-written script to generate a service deployment package in the following specific manner:

[0056] The pre-written script parses the preset first configuration file in the target code to obtain the service module to be iteratively updated.

[0057] The code corresponding to the service module is compiled according to the pre-written script to obtain the updated service module;

[0058] Modify the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program;

[0059] Based on the current service program deployment package, the second configuration file, and the updated service module, an updated service deployment package is generated.

[0060] The second configuration file includes at least one of the following: a database configuration file and a Consul address file;

[0061] After the processing module modifies the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the device further includes:

[0062] The parsing module is used to parse the third configuration file corresponding to the service scripts that need to be iteratively updated.

[0063] The first search module is used to locate the service script based on the third configuration file parsed by the parsing module.

[0064] The update module is also used to download the service script found by the search module and update the service script according to the third configuration file parsed by the parsing module;

[0065] The service scripts include SQL statement scripts.

[0066] As an optional implementation, in the second aspect of the present invention, the specific method by which the processing module processes the service deployment package according to the pre-written script, generates the target image, and pushes the target image is as follows:

[0067] The service deployment package is processed according to the pre-written script and the service identifier of the service program to generate the target image and push the image to the API of the TSF platform;

[0068] The update module performs rolling updates on the target image after it is pushed, based on the pre-written script and the API of the TSF platform, and generates the target release package in the following specific way:

[0069] The API interface provided by the TSF platform is invoked based on the pre-written script and the service identifier of the service program;

[0070] The target image is continuously updated after being pushed through the CURL command and API parameters in the API interface;

[0071] The TSF platform is a third-party microservice platform.

[0072] The device further includes:

[0073] The storage module is used to store the target release package updated by the update module in the version backup repository according to the pre-written script.

[0074] As an optional implementation, in a second aspect of the invention, after the storage module stores the target release package in the version backup repository according to the pre-written script, the apparatus further includes:

[0075] The first judgment module is used to determine whether the version of the target release package stored in the storage module needs to be rolled back;

[0076] The acquisition module is further configured to acquire the rollback version corresponding to the target release package through the string param provided by JENKINS when the first judgment module determines that the target release package needs to be rolled back;

[0077] The selection module is used to select the service module that needs to be rolled back based on the rollback version obtained by the acquisition module.

[0078] The update module is further configured to read the version of JENKINS according to the pre-written script, and update the target release package according to the version of JENKINS and the service module to be rolled back selected by the selection module, thereby generating an updated target release package.

[0079] The processing module is further configured to process the updated target release package obtained by the update module according to the pre-written script, generate a second target image, and push the second target image.

[0080] As an optional implementation, in a second aspect of the invention, before the acquisition module acquires the target code corresponding to the service program to be deployed in the code repository, the apparatus further includes:

[0081] The second judgment module is used to determine whether the service program needs to be rolled back. When it is determined that the service program does not need to be rolled back, the acquisition module is triggered again to perform the operation of acquiring the target code corresponding to the service program to be deployed from the code repository.

[0082] The second search module is used to search for the corresponding required rollback version backup from the version backup repository when the second judgment module determines that the service program needs to be rolled back to a version.

[0083] The generation module is used to regenerate the release package corresponding to the version of the service program based on the code of the rollback version backup found by the second search module.

[0084] As an optional implementation, in a second aspect of the invention, after the processing module modifies the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the apparatus further includes:

[0085] The parsing module is also used to parse the preset first configuration file in the target code according to the pre-written script to obtain the service script to be iteratively updated;

[0086] The update module is further configured to update the code corresponding to the service script parsed by the parsing module according to the pre-written script, so as to obtain the updated service script.

[0087] A third aspect of the present invention discloses another pipeline-based automated deployment device, the device comprising:

[0088] Memory containing executable program code;

[0089] A processor coupled to the memory;

[0090] The processor calls the executable program code stored in the memory to execute some or all of the steps in the pipeline-based automated deployment method disclosed in the first aspect of the present invention.

[0091] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the pipeline-based automated deployment method disclosed in the first aspect of the present invention.

[0092] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: a pipeline-based automated deployment method and apparatus are provided. The pipeline-based automated deployment method includes: obtaining the target code corresponding to the service program to be deployed from the code repository; processing the target code according to the pre-written script to generate a service deployment package; processing the service deployment package according to the pre-written script to generate a target image and push the target image; performing rolling updates on the pushed target image according to the pre-written script and the API of the TSF platform to generate a target release package, wherein the target release package includes the iteratively updated service program. Implementing this invention enables the acquisition of target code corresponding to the service program to be deployed from a code repository, allowing for rapid access to the latest running code of the service program. This improves deployment efficiency and reduces deployment costs. The invention further enhances the automation of service program deployment by processing the target code using pre-written scripts to generate a service deployment package, then processing the service deployment package using the same scripts to generate and push a target image. This improves deployment efficiency and reduces deployment costs. Finally, the invention provides rolling updates to the pushed target image using pre-written scripts and the TSF platform's API to generate a target release package. This target release package includes iteratively updated service programs, allowing the use of third-party APIs to mitigate computational resource consumption and reduce resource occupancy during deployment. This, in turn, further improves deployment efficiency and reduces deployment costs. Attached Figure Description

[0093] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0094] Figure 1 This is a flowchart illustrating an automated deployment method based on a pipeline disclosed in an embodiment of the present invention;

[0095] Figure 2 This is a flowchart illustrating another automated deployment method based on a pipeline disclosed in an embodiment of the present invention;

[0096] Figure 3 This is a schematic diagram of the structure of an automated deployment device based on a pipeline disclosed in an embodiment of the present invention;

[0097] Figure 4 This is a schematic diagram of another automated deployment device based on a pipeline disclosed in an embodiment of the present invention;

[0098] Figure 5 This is a schematic diagram of the structure of another automated deployment device based on a pipeline disclosed in an embodiment of the present invention. Detailed Implementation

[0099] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0100] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0101] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0102] This invention discloses a pipeline-based automated deployment method and apparatus. The pipeline-based automated deployment method includes: obtaining the target code corresponding to the service program to be deployed from a code repository; processing the target code according to a pre-written script to generate a service deployment package; processing the service deployment package according to a pre-written script to generate a target image and push the target image; performing rolling updates on the pushed target image according to the pre-written script and the API of the TSF platform to generate a target release package, wherein the target release package includes the iteratively updated service program. Implementing this invention enables the acquisition of target code corresponding to the service program to be deployed from a code repository, allowing for rapid access to the latest running code of the service program. This improves deployment efficiency and reduces deployment costs. The invention further enhances the automation of service program deployment by processing the target code using pre-written scripts to generate a service deployment package, then processing the service deployment package using the same scripts to generate and push a target image. This further improves deployment efficiency and reduces deployment costs. The invention also performs rolling updates on the pushed target image using the pre-written scripts and the TSF platform's API to generate a target release package. This target release package includes the iteratively updated service program, allowing the use of third-party APIs to transfer computational resource consumption and reduce the utilization of deployment processing resources, thereby improving deployment efficiency and reducing deployment costs. These details are described in detail below.

[0103] Example 1

[0104] Please see Figure 1 , Figure 1 This is a schematic diagram of a pipeline-based automated deployment method disclosed in an embodiment of the present invention. Figure 1 The described pipeline-based automated deployment method can be applied to a pipeline framework and to a pipeline-based automated deployment device, which can be used on a local terminal device or a cloud device. The local terminal device can include at least one of a PC terminal, a local server, etc., and the cloud device can include at least one of a cloud host, a cloud server, a cloud virtual device, etc., without limitation in this embodiment of the invention. Figure 1 As shown, this pipeline-based automated deployment method may include the following operations:

[0105] 101. Obtain the target code corresponding to the service program to be deployed from the code repository.

[0106] In this embodiment of the invention, optionally, the pipeline can be a workflow framework used to implement continuous integration and continuous delivery.

[0107] In this embodiment of the invention, optionally, obtaining the target code corresponding to the service to be deployed in the code repository may include:

[0108] Download the target code corresponding to the service to be deployed based on the pre-written script.

[0109] Obtain the target code using JENKINS' SCM plugin.

[0110] JENKINS is a continuous integration tool. SCM is used to poll the version control system's code for updates. If an update is detected, it triggers the operation of retrieving the updated target code.

[0111] In this embodiment of the invention, optionally, the pre-written script can be a shell script called in the pipeline environment, and the pre-written script can include multiple sub-scripts.

[0112] This allows JENKINS' SCM plugin to retrieve the target code for the service program to be deployed from the code repository, enabling quick access to the latest running code for the service program. This, in turn, improves the efficiency of service program deployment and reduces deployment costs.

[0113] 102. Process the target code according to the pre-written script and generate the service deployment package.

[0114] In this embodiment of the invention, optionally, processing the target code according to a pre-written script to generate a service deployment package may include:

[0115] The pre-written script parses the preset first configuration file in the target code to obtain the service module that needs to be iteratively updated.

[0116] The updated service module is obtained by compiling the code corresponding to the pre-written script.

[0117] The second configuration file corresponding to the updated service module is modified based on the pre-written script and the service identifier of the service program.

[0118] The updated service deployment package is generated by integrating the current service program's deployment package, the second configuration file, and the updated service modules.

[0119] The first configuration file may include at least one of the following information files: the identification information of the location of the service module to be iteratively updated, the update time of the service module, and the information of the personnel who performed the update of the service module. The second configuration file may include at least one of the following information files: database configuration file, Consul address file, etc. The service deployment package includes at least one of the following: the logic code corresponding to the updated service program, configuration file information, configuration environment information, version information, service identification information, encryption security information, etc.

[0120] In this embodiment of the invention, optionally, the updated service module is obtained by compiling the code corresponding to the service module based on the pre-written script, specifically including:

[0121] The code corresponding to the service module is compiled incrementally according to the pre-written script to obtain the incrementally updated service module.

[0122] This method parses the pre-defined first configuration file in the target code using a pre-written script to obtain the service modules that need to be iteratively updated. Then, it compiles and updates the service modules and modifies the configuration files according to the pre-written script. Finally, it integrates and generates the updated service deployment package. Compared with the iterative deployment method that covers the entire version, the incremental deployment method for the corresponding modules that need to be updated can effectively improve the accuracy and automation of service deployment. Moreover, the more detailed the information contained in the service deployment package, the more beneficial it is to improve the deployment efficiency of the service program and reduce the deployment cost.

[0123] 103. Process the service deployment package according to the pre-written script, generate the target image and push the target image.

[0124] In this embodiment of the invention, optionally, generating and pushing the target image based on the pre-written script to process the service deployment package may include:

[0125] The service deployment package is processed based on a pre-written script and the service identifier of the service program, generating a target image and pushing the target image to the TSF platform's API. This method of processing the service deployment package based on its service identifier to obtain the image of that service deployment package improves the transmission and storage of the service deployment package, thereby increasing the efficiency of service program deployment and reducing deployment costs.

[0126] 104. Based on the pre-written script and the TSF platform API, perform rolling updates on the target image after push to generate the target release package.

[0127] In this embodiment, optionally, the target release package may include an iteratively updated service program.

[0128] In this embodiment of the invention, optionally, performing rolling updates on the target image after push according to a pre-written script and the API of the TSF platform to generate a target release package may include:

[0129] The API interface provided by the TSF platform is invoked based on the pre-written script and the service identifier of the service program.

[0130] The target image is updated on a rolling basis using the CURL command and API parameters in the API interface after being pushed.

[0131] The TSF platform can be TECENT's microservice platform, and its API interface is used to configure the target image as a microservice.

[0132] CURL commands are a file transfer tool that uses URL rules to work on the command line, and is used to send network requests such as GET and POST.

[0133] Based on the pre-written script and the TSF platform's API, the target image is continuously updated after being pushed to generate the target release package. This can make full use of the microservice resources of the third-party platform, facilitate the transfer of the required computing resources, reduce the occupancy of processing resources, and improve the speed and performance of service deployment. In this way, it can improve the deployment efficiency of service programs and reduce deployment costs.

[0134] In an optional embodiment, after modifying the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the method may further include the following operations:

[0135] The third configuration file corresponding to the service script that needs to be iteratively updated is parsed, and the location of the service script is found based on the third configuration file.

[0136] Download the service script and update the service script according to the third configuration file.

[0137] The service scripts can include SQL statement scripts.

[0138] As can be seen, this optional embodiment can update the corresponding service script in the service program through the third configuration file corresponding to the service script to be updated, avoiding redundancy caused by repeated overwriting of service scripts, which is conducive to improving the deployment efficiency of the service program and reducing deployment costs.

[0139] In another alternative embodiment, after performing step 104, the method further includes the following operations:

[0140] The target release package is stored in the version backup repository according to a pre-written script.

[0141] As can be seen, this embodiment can store the target release package in the version backup repository according to the pre-written script after the release package is generated, so that when the service program version needs to be changed, the corresponding program version can be quickly selected from the backup repository for redeployment, thereby improving the deployment efficiency of the service program and reducing the deployment cost.

[0142] In this optional embodiment, after storing the target release package in the version backup repository according to a pre-written script, the method may further include the following operations.

[0143] Determine whether the version of the target release package needs to be rolled back.

[0144] When it is determined that the target release package needs to be rolled back, the corresponding rollback version of the target release package is obtained through the string param provided by JENKINS.

[0145] Select the service module that needs to be rolled back based on the rollback version.

[0146] The script reads the JENKINS version and updates the target release package based on the JENKINS version and the service modules that need to be rolled back, generating the updated target release package.

[0147] The updated target release package is processed according to a pre-written script, a second target image is generated, and the second target image is pushed.

[0148] Here, string param can represent a string parameter used to request the rollback version corresponding to the target release package.

[0149] As can be seen, this optional embodiment can, after the target release package is stored in the version backup repository, when it is detected that the service version needs to be rolled back due to misoperation or other reasons, roll back and update the service module corresponding to the release package according to the service version to be rolled back and regenerate a new image, thereby reducing the cost loss caused by misoperation in version iteration, which is conducive to improving the deployment efficiency of service programs and reducing deployment costs.

[0150] In yet another optional embodiment, after modifying the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the method may further include the following operations:

[0151] The pre-written script parses the first configuration file in the target code to obtain the service script that needs to be iteratively updated.

[0152] The updated service script is obtained by updating the code corresponding to the pre-written service script.

[0153] As can be seen, this optional embodiment can update the service scripts that need to be iteratively updated in the service program through the preset first configuration file in the target code, avoiding redundancy caused by repeated overwriting of service scripts, which is conducive to improving the deployment efficiency of the service program and reducing deployment costs.

[0154] Example 2

[0155] Please see Figure 2 , Figure 2 This is a schematic diagram of a pipeline-based automated deployment method disclosed in an embodiment of the present invention. Figure 1 The described pipeline-based automated deployment method can be applied to a pipeline framework and to a pipeline-based automated deployment device, which can be used on a local terminal device or a mobile terminal device. The local terminal device can include at least one of a PC terminal, a local server, etc., and the cloud device can include at least one of a cloud host, a cloud server, a cloud virtual device, etc., without limitation in this embodiment of the invention. Figure 2 As shown, this pipeline-based automated deployment method may include the following operations:

[0156] 201. Determine whether the service program needs to be rolled back. If it is determined that the service program needs to be rolled back, proceed to step 202. If it is determined that the service program does not need to be rolled back, proceed to step 203.

[0157] 202. Locate the required rollback version backup in the version backup repository, and regenerate the corresponding version of the service program release package based on the code of the rollback version backup.

[0158] 203. Obtain the target code corresponding to the service program to be deployed from the code repository.

[0159] 204. Process the target code according to the pre-written script and generate the service deployment package.

[0160] 205. Process the service deployment package according to the pre-written script, generate the target image and push the target image.

[0161] 206. Based on the pre-written script and the API of the TSF platform, perform rolling updates on the target image after push to generate the target release package.

[0162] In this embodiment of the invention, it should be noted that for the relevant descriptions of steps 203-206, please refer to steps 101-104 in Embodiment 1, and these will not be repeated in this embodiment of the invention.

[0163] As can be seen, the embodiments of the present invention can also obtain the target code corresponding to the service program to be deployed from the code repository, and before generating the release package according to the pre-written script, detect whether the service version of the service program needs to be rolled back and updated according to the corresponding version requirements. When the requirement is detected, the logic code corresponding to the release package that needs to be updated is rolled back and updated according to the service version that needs to be rolled back, and the release package is regenerated. This reduces the deployment operation of re-iterating the version, thereby improving the deployment efficiency of the service program and reducing the deployment cost.

[0164] It is evident that implementation Figure 2 The described method can obtain the target code corresponding to the service program to be deployed from the code repository, so as to quickly obtain the latest running code of the service program, which is beneficial to improve the deployment efficiency and reduce the deployment cost. It processes the target code according to a pre-written script to generate a service deployment package, processes the service deployment package according to a pre-written script to generate a target image, and pushes the target image, which improves the automation of service program deployment, further enhancing deployment efficiency and reducing deployment costs. It performs rolling updates on the pushed target image according to the pre-written script and the TSF platform API to generate a target release package, which includes iterative updates. The subsequent service program allows the use of third-party APIs to transfer the consumption of computing resources, reducing the utilization of deployment processing resources, thereby improving the deployment efficiency and reducing deployment costs. Furthermore, before obtaining the target code corresponding to the service program to be deployed from the code repository, it can detect whether the service version of the service program needs to be rolled back according to the corresponding version requirements. When a requirement is detected, the logic code corresponding to the required update in the release package is rolled back and updated according to the service version to be rolled back, and the release package is regenerated. This reduces the deployment operation of re-iterating versions, further improving the deployment efficiency and reducing deployment costs.

[0165] Example 3

[0166] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an automated deployment device based on a pipeline, as disclosed in an embodiment of the present invention. Figure 3 The described pipeline-based automated deployment device is applied to a pipeline framework and can execute the aforementioned pipeline-based automated deployment method. This device can be applied to local terminal devices or mobile terminal devices. The local terminal device may include at least one of a PC terminal, a local server, etc., and the cloud device may include at least one of a cloud host, a cloud server, a cloud virtual device, etc. This embodiment of the invention does not impose limitations. Figure 3As shown, the device may include: an acquisition module 301, a processing module 302, and an update module 303, wherein:

[0167] The acquisition module 301 is used to obtain the target code corresponding to the service program to be deployed from the code repository.

[0168] Processing module 302 is used to generate a service deployment package by processing the target code obtained by the processing module according to the pre-written script.

[0169] The processing module 302 is also used to process the service deployment package according to the pre-written script, generate the target image and push the target image.

[0170] The update module 303 is used to perform rolling updates on the target image pushed by the processing module according to the pre-written script and the API of the TSF platform, and generate a target release package, which includes the iteratively updated service program.

[0171] It is evident that implementation Figure 3 The described pipeline-based automated deployment device can obtain the target code corresponding to the service program to be deployed from the code repository, so as to quickly obtain the latest running code of the service program, which is conducive to improving the deployment efficiency and reducing the deployment cost. It processes the target code according to a pre-written script, generates a service deployment package, processes the service deployment package according to a pre-written script, generates a target image, and pushes the target image, which improves the automation level of service program deployment, further enhancing deployment efficiency and reducing deployment costs. It also performs rolling updates on the pushed target image according to the pre-written script and the TSF platform API, generating a target release package. The target release package includes the iteratively updated service program, allowing the use of third-party APIs to transfer the consumption of computing resources, reducing the utilization of deployment processing resources, thereby further improving the deployment efficiency and reducing deployment costs.

[0172] In an optional embodiment, the pipeline is a workflow framework, and the pre-written scripts are shell scripts called under the pipeline framework, and the pre-written scripts include multiple sub-scripts.

[0173] And, such as Figure 4 As shown, the specific method by which module 301 obtains the target code corresponding to the service to be deployed in the code repository is as follows:

[0174] Download the target code corresponding to the service to be deployed based on the pre-written script.

[0175] Obtain the target code using JENKINS' SCM plugin.

[0176] JENKINS is a continuous integration tool.

[0177] It is evident that implementation Figure 4 The described pipeline-based automated deployment device uses pre-written shell scripts and JENKINS' SCM plugin to retrieve the target code corresponding to the service program to be deployed from the code repository, so as to quickly obtain the latest running code of the service program, thereby improving the deployment efficiency of the service program and reducing the deployment cost.

[0178] In another optional embodiment, the processing module 302 processes the target code according to a pre-written script to generate the service deployment package in the following manner:

[0179] The pre-written script parses the preset first configuration file in the target code to obtain the service module that needs to be iteratively updated.

[0180] The updated service module is obtained by compiling the code corresponding to the pre-written script.

[0181] The second configuration file corresponding to the updated service module is modified based on the pre-written script and the service identifier of the service program.

[0182] The updated service deployment package is generated by integrating the current service program's deployment package, the second configuration file, and the updated service modules.

[0183] The second configuration file includes at least one of the following: a database configuration file and a Consul address file.

[0184] After the processing module 302 modifies the updated second configuration file corresponding to the service module according to the pre-written script and the service identifier of the service program, the device further includes:

[0185] Parsing module 304 is used to parse the third configuration file corresponding to the service script that needs to be iteratively updated.

[0186] The first lookup module 305 is used to find the location of the service script based on the third configuration file parsed by the parsing module 304.

[0187] The update module 303 is also used to download the service script found by the first search module 305 and update the service script according to the third configuration file obtained by the parsing module.

[0188] The service scripts include SQL statement scripts.

[0189] It is evident that implementation Figure 4The described pipeline-based automated deployment device parses a pre-defined first configuration file in the target code according to a pre-written script, obtains the service modules that need to be iteratively updated, compiles and updates the service modules according to the pre-written script, and modifies the configuration files. Finally, it integrates and generates an updated service deployment package. Compared with iterative deployment methods that cover all versions, incremental deployment for the modules that need to be updated can effectively improve the accuracy and automation of service deployment. By updating the corresponding service scripts in the service program through the third configuration file corresponding to the service scripts that need to be updated, redundancy caused by repeated overwriting of service scripts is avoided, which helps to improve the deployment efficiency of the service program and reduce deployment costs.

[0190] In yet another alternative embodiment, such as Figure 4 As shown, the specific method by which processing module 302 processes the service deployment package according to the pre-written script, generates the target image, and pushes the target image is as follows:

[0191] Based on the pre-written script and the service identifier of the service program, the service deployment package is processed, the target image is generated, and the image is pushed to the TSF platform API.

[0192] Update module 303 performs rolling updates on the target image after it is pushed, based on a pre-written script and the API of the TSF platform. The specific method for generating the target release package is as follows:

[0193] The API interface provided by the TSF platform is invoked based on the pre-written script and the service identifier of the service program.

[0194] The target image is updated on a rolling basis using the CURL command and API parameters in the API interface after being pushed.

[0195] The TSF platform is a third-party microservice platform.

[0196] The device also includes:

[0197] Storage module 306 is used to store the target release package updated by version backup repository storage update module 303 according to a pre-written script.

[0198] It is evident that implementation Figure 4The described pipeline-based automated deployment device processes service deployment packages based on service identifiers to obtain an image of the service deployment package, improving the transmission and storage of service deployment packages, which is beneficial for improving the deployment efficiency of service programs and reducing deployment costs. It also performs rolling updates on the pushed target image based on pre-written scripts and the TSF platform's API to generate a target release package. This fully utilizes the microservice resources of third-party platforms, facilitates the transfer of required computing resources, reduces the occupancy of processing resources, and improves the speed and performance of service deployment, thereby improving the deployment efficiency of service programs and reducing deployment costs.

[0199] In yet another alternative embodiment, such as Figure 4 As shown, after storage module 306 stores the target release package in the version backup repository according to a pre-written script, the device further includes:

[0200] The first judgment module 307 is used to determine whether the version of the target release package stored in the storage module 306 needs to be rolled back.

[0201] The acquisition module 301 is also used to obtain the rollback version corresponding to the target release package through the string param provided by JENKINS when the first judgment module 307 determines that the target release package needs to be rolled back.

[0202] Select module 308 is used to select the service module that needs to be rolled back based on the rollback version obtained by acquisition module 301.

[0203] The update module 303 is also used to read the version of JENKINS according to the pre-written script, and update the target release package according to the version of JENKINS and the service module to be rolled back selected by the selection module 308, so as to generate the updated target release package.

[0204] The processing module 302 is also used to process the updated target release package obtained by the update module 303 according to the pre-written script, generate the second target image and push the second target image.

[0205] It is evident that implementation Figure 4 The described pipeline-based automated deployment device, after the target release package is stored in the version backup repository, can roll back and update the service modules corresponding to the release package and regenerate a new image when it is detected that a service version needs to be rolled back due to misoperation or other reasons. This reduces the cost loss caused by misoperation in version iteration, thereby improving the deployment efficiency of service programs and reducing deployment costs.

[0206] In yet another alternative embodiment, such as Figure 4As shown, before the acquisition module 301 acquires the target code corresponding to the service program to be deployed in the code repository, the device further includes:

[0207] The second judgment module 309 is used to determine whether the service program needs to be rolled back. When it is determined that the service program does not need to be rolled back, the acquisition module 301 is triggered again to perform the operation of obtaining the target code corresponding to the service program to be deployed from the code repository.

[0208] The second search module 310 is used to search for the corresponding required rollback version backup from the version backup repository when the second judgment module 309 determines that the service program needs to be rolled back.

[0209] The generation module 311 is used to regenerate the release package of the corresponding version of the service program based on the code of the rollback version backup found by the second search module 310.

[0210] It is evident that implementation Figure 4 The described pipeline-based automated deployment device updates the service scripts that need to be iteratively updated in the service program through a preset first configuration file in the target code, avoiding redundancy caused by repeated overwriting of service scripts, thereby improving the deployment efficiency of the service program and reducing deployment costs.

[0211] In yet another alternative embodiment, such as Figure 4 As shown, after the processing module 302 modifies and updates the second configuration file corresponding to the service module according to the pre-written script and the service identifier of the service program, the device further includes:

[0212] The parsing module 304 is also used to parse the preset first configuration file in the target code according to the pre-written script to obtain the service script that needs to be iteratively updated.

[0213] The update module 303 is also used to update the code corresponding to the service script parsed by the parsing module according to the pre-written script, so as to obtain the updated service script.

[0214] It is evident that implementation Figure 4 The described pipeline-based automated deployment device can obtain the target code corresponding to the service program to be deployed from the code repository. Before generating the release package by processing the target code according to the pre-written script, it checks whether the service version of the service program needs to be rolled back according to the corresponding version requirements. When a requirement is detected, it rolls back the logic code corresponding to the release package that needs to be updated according to the service version to be rolled back and regenerates the release package. This reduces the deployment operation of re-iterating the version, thereby improving the deployment efficiency of the service program and reducing the deployment cost.

[0215] Example 4

[0216] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an automated deployment device based on a pipeline, as disclosed in an embodiment of the present invention. Figure 5 The described pipeline-based automated deployment device is applied to a pipeline framework and can execute the aforementioned pipeline-based automated deployment method. This device can be applied to local terminal devices or mobile terminal devices. The local terminal device may include at least one of a PC terminal, a local server, etc., and the cloud device may include at least one of a cloud host, a cloud server, a cloud virtual device, etc. This embodiment of the invention does not impose limitations. Figure 5 As shown, the device may include:

[0217] Memory 501 storing executable program code;

[0218] Processor 502 coupled to memory 501;

[0219] Furthermore, it may also include an input interface 503 and an output interface 504 coupled to the processor 502;

[0220] The processor 502 calls the executable program code stored in the memory 501 to execute some or all of the steps in the pipeline-based automated deployment method disclosed in Embodiment 1 or Embodiment 2 of the present invention.

[0221] Example 5

[0222] This invention discloses a computer-storable medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in the pipeline-based automated deployment method disclosed in Embodiment 1 or Embodiment 2 of this invention.

[0223] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0224] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0225] Finally, it should be noted that the automated deployment method and apparatus based on pipeline disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A pipeline-based automated deployment method applied to a pipeline framework, characterized in that, The method comprises: obtaining target code corresponding to a service program required for deployment from a code repository; processing the target code according to a pre-written script to generate a service deployment package; processing the service deployment package according to the pre-written script to generate a target image and pushing the target image; performing rolling update on the pushed target image according to the pre-written script and an API of a TSF platform to generate a target release package, wherein the target release package comprises an iteratively updated service program; the processing of the target code according to the pre-written script to generate the service deployment package comprises: parsing a preset first configuration file in the target code according to the pre-written script to obtain a service module required for iterative update; compiling code corresponding to the service module according to the pre-written script to obtain an updated service module; modifying a second configuration file corresponding to the updated service module according to the pre-written script and a service identifier of the service program; integrating a deployment package of the current service program, the second configuration file and the updated service module to generate an updated service deployment package; wherein the first configuration file comprises at least one of identifier information of a location where the service module required for iterative update is located, update time of the service module, and update execution personnel information of the service module, the second configuration file comprises at least one of a database configuration file and a consul address file, and the service deployment package comprises at least one of logical code corresponding to the updated service program, configuration file information, configuration environment information, version information, service identifier information and encrypted security information; wherein the compiling of the code corresponding to the service module according to the pre-written script to obtain the updated service module comprises: compiling the code corresponding to the service module in an incremental compilation manner according to the pre-written script to obtain an incrementally updated service module; after the modifying of the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the method further comprises: parsing a third configuration file corresponding to a service script required for iterative update, and finding a location of the service script according to the third configuration file; downloading the service script and updating the service script according to the third configuration file; and / or parsing a preset first configuration file in the target code according to the pre-written script to obtain a service script required for iterative update; updating code corresponding to the service script according to the pre-written script to obtain an updated service script; wherein the service script comprises a SQL statement script.

2. The pipeline-based automated deployment method of claim 1, wherein, The pipeline is a workflow framework, the pre-written script is a script written in shell language invoked under the pipeline framework, and the pre-written script comprises a plurality of subscripts. the obtaining of the target code corresponding to the service required for deployment from the code repository comprises: downloading the target code corresponding to the service required for deployment according to the pre-written script; acquire the target code according to an SCM plug-in of Jenkins; wherein the Jenkins is a continuous integration tool.

3. The pipeline-based automated deployment method of claim 2, wherein, The processing of the service deployment package according to the pre-written script, the generation of the target image and the pushing of the target image include: processing the service deployment package according to the pre-written script and the service identifier of the service program, generating a target image and pushing the image to an API of a TSF platform; The rolling update of the target image pushed according to the pre-written script and the API of the TSF platform, the generation of a target release package include: calling an API interface provided by the TSF platform according to the pre-written script and the service identifier of the service program; performing a rolling update on the target image pushed through a CURL command and API parameters in the API interface; wherein the TSF platform is a third-party micro-service platform; The method further includes: storing the target release package in a version backup warehouse according to the pre-written script.

4. The pipeline-based automated deployment method of claim 3, wherein, After the storing of the target release package in the version backup warehouse according to the pre-written script, the method further includes: judging whether the version of the target release package needs to be rolled back; when it is judged that the target release package needs to be rolled back, acquiring a rollback version corresponding to the target release package through a string param provided by Jenkins; selecting a service module that needs to be rolled back according to the rollback version; reading a version of Jenkins according to the pre-written script, and updating the target release package according to the version of Jenkins and the service module that needs to be rolled back, to generate an updated target release package; processing the updated target release package according to the pre-written script, generating a second target image and pushing the second target image.

5. The pipeline-based automated deployment method of claim 4, wherein, Before the acquiring of the target code corresponding to the service program needed to be deployed from the code warehouse, the method further includes: judging whether the service program needs to be rolled back; when it is judged that the service program needs to be rolled back, searching for a backup corresponding to the rollback version needed from the version backup warehouse, and regenerating a release package of the version of the service program according to the code of the rollback version backup; when it is judged that the service program does not need to be rolled back, re-executing the operation of acquiring the target code corresponding to the service program needed to be deployed from the code warehouse.

6. A pipeline-based automated deployment apparatus, characterized by, The device includes: an acquiring module, configured to acquire target code corresponding to a service program needed to be deployed from a code warehouse; a processing module, configured to process the target code acquired by the acquiring module according to a pre-written script, to generate a service deployment package; The processing module is further configured to process the service deployment package according to the pre-written script, to generate a target image and push the target image; an updating module, configured to perform a rolling update on the target image pushed by the processing module according to the pre-written script and an API of a TSF platform, to generate a target release package, the target release package including an iteratively updated service program; The processing module processes the target code according to a pre-written script, and a specific way of generating a service deployment package is: According to the pre-written script, a preset first configuration file in the target code is parsed to obtain a service module required to be iteratively updated; According to the pre-written script, code corresponding to the service module is compiled to obtain an updated service module; According to the pre-written script and a service identifier of the service program, a second configuration file corresponding to the updated service module is modified; Based on a deployment package of the current service program, the second configuration file and the updated service module, an updated service deployment package is generated; The first configuration file includes at least one of the following: identification information of a location of the service module required to be iteratively updated, update time of the service module, and update execution personnel information of the service module, the second configuration file includes at least one of the following: a database configuration file and a consul address file, and the service deployment package includes at least one of the following: logical code corresponding to the updated service program, configuration file information, configuration environment information, version information, service identifier information, and encryption security information; According to the pre-written script, the code corresponding to the service module is compiled in an incremental compilation manner to obtain an incrementally updated service module; After the processing module modifies the second configuration file corresponding to the updated service module according to the pre-written script and the service identifier of the service program, the device further includes: A parsing module configured to parse a third configuration file corresponding to a service script required to be iteratively updated; A first finding module configured to find a location of the service script according to the third configuration file parsed by the parsing module; The updating module is further configured to download the service script found by the finding module and update the service script according to the third configuration file parsed by the parsing module; The parsing module is further configured to parse a preset first configuration file in the target code according to the pre-written script to obtain a service script required to be iteratively updated; The updating module is further configured to update code corresponding to the service script parsed by the parsing module according to the pre-written script to obtain an updated service script; The service script includes a SQL statement script. The device includes:

7. A pipeline-based automated deployment apparatus, characterized by, A memory storing executable program code; A processor coupled to the memory; The processor invokes the executable program code stored in the memory to execute the pipeline-based automated deployment method according to any one of claims 1-5. The computer storage medium stores computer instructions, which are invoked to execute the pipeline-based automated deployment method according to any one of claims 1-5.

8. A computer storage medium, characterized in that ​