Application deployment method, device, storage medium and electronic device

By obtaining and registering application service information, calling pipelines for testing and compilation, and finally deploying to the target server, it solves the problems of cumbersome and inefficient application deployment steps in the existing technology, and realizes a simplified deployment process and an efficient deployment process.

CN114356346BActive Publication Date: 2025-05-09BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210002273.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2025-05-09
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

In the prior art, the application deployment method is complicated, the steps are low, and the cost of use is high.

Method used

By obtaining the registered application service information of the application to be deployed, calling the pipeline interface to start the pipeline, obtaining program code, testing and compiling, and finally deploying the compiled program code based on the IP address of the target server.

Benefits of technology

This simplifies steps for application deployment methods, improves deployment efficiency and reduces usage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356346B_ABST
    Figure CN114356346B_ABST
Patent Text Reader

Abstract

The present invention discloses an application deployment method, device, storage medium and electronic device. The method comprises: obtaining application service information registered by the application to be deployed, wherein the application service information comprises the storage address of the application in the storage warehouse, the deployment mode of the application, and the target IP address of the target server to be deployed; calling the pipeline interface to start the pipeline; obtaining the program code of the application through the pipeline and the storage address; testing the program code; and if the program code test passes, deploying the compiled program code to the target server according to the target IP address of the target server and the deployment mode. The present invention solves the technical problem that the application deployment method has cumbersome steps and low efficiency in deploying applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an application deployment method, device, storage medium and electronic device. Background Art

[0002] In the prior art, each time an application is deployed, a pipeline script needs to be written, and the steps are cumbersome. If multiple applications need to be deployed, multiple pipeline scripts need to be written, resulting in cumbersome steps for deploying the application and low efficiency in deploying the application. Summary of the invention

[0003] The embodiments of the present invention provide an application deployment method, device, storage medium and electronic device to at least solve the technical problems of complicated application deployment steps and high use cost.

[0004] According to one aspect of an embodiment of the present invention, there is provided an application deployment method, comprising: obtaining application service information registered by an application to be deployed, wherein the application service information includes a storage address of the application in a storage repository, a deployment method of the application, and a target IP address of a target server to be deployed; calling a pipeline interface to start the pipeline; obtaining the program code of the application through the pipeline and the storage address; testing the program code; and if the program code test passes, deploying the compiled program code to the target server according to the target IP address of the target server and the deployment method.

[0005] According to another aspect of an embodiment of the present invention, an application deployment device is provided, including: a first acquisition module, used to obtain application service information registered by an application to be deployed, wherein the above-mentioned application service information includes the storage address of the above-mentioned application in a storage warehouse, the deployment method of the above-mentioned application, and the target IP address of the target server to be deployed; a calling module, used to call a pipeline interface to start the pipeline; a second acquisition module, used to obtain the program code of the above-mentioned application through the above-mentioned pipeline and the above-mentioned storage address; a testing module, used to test the above-mentioned program code; and a deployment module, used to deploy the above-mentioned compiled program code to the above-mentioned target server according to the above-mentioned deployment method according to the target IP address of the above-mentioned target server when the above-mentioned program code test passes.

[0006] As an optional example, the second acquisition module includes: a calling unit, used to call the target script after starting the pipeline, wherein the target script is an automatic execution script; and a pulling unit, used to access the storage address through the target script and pull the program code of the application from the storage address.

[0007] As an optional example, the above-mentioned test module includes: a checking unit, which is used to check the integrity of the above-mentioned program code; and a testing unit, which is used to perform automated testing on the above-mentioned program code using test cases when the above-mentioned program code is complete.

[0008] As an optional example, the above-mentioned deployment module includes: an acquisition unit, used to obtain the IP address of each server in the server set used to deploy the application, wherein the above-mentioned server set includes the above-mentioned target server; a comparison unit, used to compare the above-mentioned target IP address with each of the above-mentioned IP addresses; and a determination unit, used to determine the server corresponding to the above-mentioned IP address that is the same as the above-mentioned target IP address as the above-mentioned target server when any of the above-mentioned IP addresses is the same as the above-mentioned target IP address.

[0009] As an optional example, the above-mentioned deployment module includes: a first publishing unit, which is used to automatically publish the above-mentioned program code to the above-mentioned target server through a target script when the above-mentioned target server is a virtual machine or a physical machine; a second publishing unit, which is used to build the compiled program code into an image when the above-mentioned target server is a server in a cluster, push the built image to an image repository, and publish the image to the above-mentioned target server through the above-mentioned target script.

[0010] As an optional example, the apparatus further includes: a compiling module, configured to compile the program code if the program code passes the test.

[0011] As an optional example, the above application service information also includes a compilation template, and the above compilation module includes: a compilation unit, which is used to compile the above program code according to the above compilation template to obtain the compiled program code, wherein different above compilation templates correspond to different language types.

[0012] According to another aspect of an embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program executes the above-mentioned application deployment method when executed by a processor.

[0013] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the application deployment method through the computer program.

[0014] In an embodiment of the present invention, a method is adopted for obtaining application service information registered by an application to be deployed, wherein the application service information includes a storage address of the application in a storage warehouse, a deployment method of the application, and a target IP address of a target server to be deployed; calling a pipeline interface to start the pipeline; obtaining the program code of the application through the pipeline and the storage address; testing the program code; and deploying the compiled program code to the target server according to the target IP address of the target server and the deployment method if the program code test passes. Since the application registration information supports reuse in the method, the pipeline can be directly called for testing, and the test is compiled and deployed, thereby achieving the purpose of simplifying the steps of the application deployment method, and further solving the technical problems of complicated steps of the application deployment method and low efficiency of deploying applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0016] Figure 1 is a flow chart of an optional application deployment method according to an embodiment of the present invention;

[0017] Figure 2 is a specific flow chart of an optional application deployment method according to an embodiment of the present invention;

[0018] Figure 3 is a schematic diagram of the structure of an optional application deployment device according to an embodiment of the present invention;

[0019] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] According to a first aspect of an embodiment of the present invention, a method for deploying an application is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0023] S102, obtaining application service information registered by the application to be deployed, wherein the application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed;

[0024] S104, calling the pipeline interface to start the pipeline;

[0025] S106, obtaining the program code of the application program through the pipeline and the storage address;

[0026] S108, testing the program code;

[0027] S110, when the program code test passes, the compiled program code is deployed to the target server according to the target IP address of the target server and in accordance with the deployment method.

[0028] Optionally, in this embodiment, a method for deploying an application is provided. Deployment is the action of publishing code to a non-local environment. For an application, when the application needs to be deployed, this method can be used to register the application service information of the application. The application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed. After registering the application service information, the application service information can be reused. For an application, when repeated deployment is required, only the registered application service information needs to be used for deployment. After registering the application service information, the pipeline interface can be called to start the pipeline. The pipeline job can obtain the program code of the application according to the storage address of the code in the application service information registered by the application, and then test the program code. After the test passes, the program code can be compiled and the compiled program code can be deployed to the target server.

[0029] Optionally, in this embodiment, the pipeline may include continuous integration (CI) / continuous deployment (CD). CI: In a continuous integration environment, developers will frequently submit code to the trunk. These new submissions need to be verified through compilation and automated testing flows before they are finally merged into the main line to ensure the quality of all submissions after merging into the main line and to provide early warnings for possible problems. CD: Continuous deployment. In this way, any modification that passes all existing workflows will be directly presented to customers. There is no human intervention (no one-click deployment button), and only a modification that fails to build in the workflow can prevent it from being deployed to the product line. The pipeline deploys the application to the target server through CI and CD.

[0030] Since the application registration information in this embodiment supports reuse, the pipeline can be directly called for testing, compiled and deployed after testing, thereby achieving the purpose of simplifying the application deployment method steps, and further solving the technical problems of cumbersome application deployment method steps and low efficiency in deploying applications.

[0031] As an optional example, program code for obtaining an application program through pipeline and storage address includes:

[0032] After starting the pipeline, call the target script, where the target script is an automatic execution script;

[0033] The storage address is accessed through the target script, and the program code of the application is pulled from the storage address.

[0034] Optionally, in this embodiment, the storage address in the application service information of the application can be obtained through the pipeline, and the storage address marks the storage location of the code of the application. The pipeline calls the target script to pull the program code of the application from the storage location.

[0035] As an optional example, testing the program code includes:

[0036] Check the integrity of program code;

[0037] When the program code is complete, use test cases to perform automated testing on the program code.

[0038] Optionally, in this embodiment, when testing the program code of the application, first check whether the program code is complete. Check whether the code is complete. A check code can be set for the program code, and the check code can be checked to check whether the program code is complete. If the program code is complete, the program code is automatically tested.

[0039] As an optional example, when the program code test passes, deploying the program code to the target server according to the target IP address of the target server in accordance with the deployment method includes:

[0040] Obtaining an IP address of each server in a server set for deploying the application, wherein the server set includes the target server;

[0041] Compare the target IP address with each IP address;

[0042] In the case where any one of the IP addresses is the same as the target IP address, the server corresponding to the IP address that is the same as the target IP address is determined as the target server.

[0043] Optionally, in this embodiment, when deploying an application to a target server, the target IP address of the target server in the application service information of the application can be obtained, and then the IP addresses of all servers are compared with the target IP address until the target server is found from all servers and the application is deployed to the target server.

[0044] As an optional example, when the program code test passes, deploying the program code to the target server according to the target IP address of the target server in accordance with the deployment method includes:

[0045] When the target server is a virtual machine or a physical machine, the program code is automatically published to the target server through the target script;

[0046] When the target server is a server in a cluster, the compiled program code is built into an image, the built image is pushed to an image repository, and the image is published to the target server through a target script.

[0047] Optionally, in this embodiment, the target server may have different types. For example, the target server may be a physical machine or a virtual machine. If the application is to be deployed on a physical machine or a virtual machine, the target script may be directly called to deploy the program code of the application on the physical machine or the virtual machine. If the target server is a server in a cluster, when the program code of the application is deployed to the target server, the program code of the application may be built into an image, and then the built image may be published to the target server. In this embodiment, the type of the target server may be included in the application service information, thereby determining the method of deploying the program code.

[0048] As an optional example, the above method further includes:

[0049] When the program code passes the test, the program code is compiled.

[0050] Optionally, in this embodiment, the program code of the application can be compiled, and during compilation, the program code of the application can be compiled into different language types to adapt to different environments. The application service information of the application can also include a compilation method and a compiled language type, so that when compiling the program code of the application, a corresponding compilation method can be selected to compile the program code of the application.

[0051] As an optional example, the application service information also includes a compilation template. When the program code test passes, compiling the program code includes:

[0052] The program code is compiled according to the compilation template to obtain the compiled program code, wherein different compilation templates correspond to different language types.

[0053] Optionally, in this embodiment, different compilation templates can be pre-set. Different compilation templates correspond to different language types. When compiling the program code of the application, select the appropriate compilation template to automatically compile.

[0054] Optionally, in this embodiment, a host console service (java) is deployed as an example, and the specific process is as follows: Figure 2 As shown:

[0055] 1. Use the self-developed CI / CD platform to provide a unified web interface to register the host console application service information, including the storage address gitURL of the service in the storage warehouse, code branch, deployment method, compilation template, that is, the template bound to the service (java), and the Internet Protocol address (IP) of the target server for deployment;

[0056] 2. The pipeline module is an abstract description of CI / CD configuration deployment. Through the setting of the pipeline on the host console, the self-developed CI / CD platform calls the pipeline through the SDK interface of the pipeline. In this embodiment, the pipeline can use the Jenkins pipeline;

[0057] 3. After the pipeline is started, the shell script is called to pull the code of the host console service from the code repository gitlab, perform code inspection and automated testing, and perform compilation according to the bound compilation template (java).

[0058] Optionally, in this embodiment, different release processes are selected according to different deployment modes:

[0059] 1. Virtual machine or physical machine deployment: automatically publish to the target server through shell scripts;

[0060] 2. Containerized deployment: Build the compiled product into an image, push it to the Image repository, and publish it to the target server through a shell script.

[0061] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0062] According to another aspect of the embodiment of the present application, an application deployment device is also provided. Figure 3 As shown, including:

[0063] The first acquisition module 302 is used to acquire application service information registered by the application to be deployed, wherein the application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed;

[0064] The calling module 304 is used to call the pipeline interface and start the pipeline;

[0065] A second acquisition module 306, used to acquire the program code of the application program through the pipeline and the storage address;

[0066] A testing module 308, used to test the program code;

[0067] The deployment module 310 is used to deploy the compiled program code to the target server according to the target IP address of the target server and in a deployment manner when the program code test passes.

[0068] Optionally, in the present embodiment, a device for deploying an application is provided. Deployment is the action of publishing code to a non-local environment. For an application, when the application needs to be deployed, this device can be used to register the application service information of the application. The application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed. After registering the application service information, the application service information can be reused. For an application, when repeated deployment is required, only the registered application service information needs to be used for deployment. After registering the application service information, the pipeline interface can be called to start the pipeline. The pipeline operation can obtain the program code of the application according to the storage address of the code in the application service information registered by the application, and then test the program code. After the test passes, the program code can be compiled and the compiled program code can be deployed to the target server.

[0069] Optionally, in this embodiment, the pipeline may include continuous integration (CI) / continuous deployment (CD). CI: In a continuous integration environment, developers will frequently submit code to the trunk. These new submissions need to be verified through compilation and automated testing flows before they are finally merged into the main line to ensure the quality of all submissions after merging into the main line and to provide early warnings for possible problems. CD: Continuous deployment. In this way, any modification that passes all existing workflows will be directly presented to customers. There is no human intervention (no one-click deployment button), and only a modification that fails to build in the workflow can prevent it from being deployed to the product line. The pipeline deploys the application to the target server through CI and CD.

[0070] Since the application registration information in this embodiment supports reuse, the pipeline can be directly called for testing, compiled and deployed after testing, thereby achieving the purpose of simplifying the application deployment method steps, thereby solving the technical problems of cumbersome application deployment method steps and low application deployment efficiency.

[0071] As an optional example, the second acquisition module includes:

[0072] The calling unit is used to call the target script after starting the pipeline, wherein the target script is an automatic execution script; the pulling unit is used to access the storage address through the target script and pull the program code of the application from the storage address.

[0073] Optionally, in this embodiment, the storage address in the application service information of the application can be obtained through the pipeline, and the storage address marks the storage location of the code of the application. The pipeline calls the target script to pull the program code of the application from the storage location.

[0074] As an optional example, the above test module includes:

[0075] The inspection unit is used to check the integrity of the program code; the test unit is used to perform automated testing on the program code using test cases when the program code is complete.

[0076] Optionally, in this embodiment, when testing the program code of the application, first check whether the program code is complete. Check whether the code is complete. A check code can be set for the program code, and the check code can be checked to check whether the program code is complete. If the program code is complete, the program code is automatically tested.

[0077] As an optional example, the above deployment module includes:

[0078] An acquisition unit, used to acquire an IP address of each server in a server set for deploying an application program, wherein the server set includes a target server;

[0079] A comparison unit, for comparing the target IP address with each IP address;

[0080] The determination unit is used to determine the server corresponding to the IP address identical to the target IP address as the target server when any IP address is identical to the target IP address.

[0081] Optionally, in this embodiment, when deploying an application to a target server, the target IP address of the target server in the application service information of the application can be obtained, and then the IP addresses of all servers are compared with the target IP address until the target server is found from all servers and the application is deployed to the target server.

[0082] As an optional example, the above deployment module includes:

[0083] A first publishing unit, used to automatically publish the program code to the target server through a target script when the target server is a virtual machine or a physical machine;

[0084] The second publishing unit is used to build the compiled program code into an image when the target server is a server in the cluster, push the built image to the image warehouse, and publish the image to the target server through a target script.

[0085] Optionally, in this embodiment, the target server may have different types. For example, the target server may be a physical machine or a virtual machine. If the application is to be deployed on a physical machine or a virtual machine, the target script may be directly called to deploy the program code of the application on the physical machine or the virtual machine. If the target server is a server in a cluster, when the program code of the application is deployed to the target server, the program code of the application may be built into an image, and then the built image may be published to the target server. In this embodiment, the type of the target server may be included in the application service information, thereby determining the method of deploying the program code.

[0086] As an optional example, the above device further includes:

[0087] The compiling module is used to compile the program code if the program code test passes.

[0088] Optionally, in this embodiment, the program code of the application can be compiled, and during compilation, the program code of the application can be compiled into different language types to adapt to different environments. The application service information of the application can also include a compilation method and a compiled language type, so that when compiling the program code of the application, a corresponding compilation method can be selected to compile the program code of the application.

[0089] As an optional example, the above compilation module includes:

[0090] The compiling unit is used to compile the program code according to the compiling template to obtain the compiled program code, wherein different compiling templates correspond to different language types.

[0091] Optionally, in this embodiment, different compilation templates can be pre-set. Different compilation templates correspond to different language types. When compiling the program code of the application, select the appropriate compilation template to automatically compile.

[0092] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0093] Figure 4 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,

[0094] Memory 406, used to store computer programs;

[0095] The processor 402 is used to implement the following steps when executing the computer program stored in the memory 406:

[0096] Obtaining application service information registered by the application to be deployed, wherein the application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed;

[0097] Call the pipeline interface to start the pipeline;

[0098] Obtaining program code of the application through pipeline and storage address;

[0099] Test the program code;

[0100] When the program code test passes, the compiled program code is deployed to the target server according to the target IP address of the target server and the deployment method.

[0101] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The communication interface is used for communication between the above electronic device and other devices.

[0102] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0103] As an example, the memory 406 may include, but is not limited to, the first acquisition module 302, the calling module 304, the second acquisition module 306, the testing module 308, and the deployment module 310 in the request processing device. In addition, other module units in the request processing device may also be included but are not limited to, which will not be repeated in this example.

[0104] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0105] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0106] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The device for implementing the above request processing method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.

[0107] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0108] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned application deployment method when executed by a processor.

[0109] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0110] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0111] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.

[0112] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0114] 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.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for deploying an application program, characterized in that: include: Obtaining application service information registered by the application to be deployed, wherein the application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed; Call the pipeline interface to start the pipeline; Acquiring the program code of the application program through the pipeline and the storage address; Testing the program code; If the program code test passes, deploying the compiled program code to the target server according to the target IP address of the target server and in accordance with the deployment method; Among them, the pipeline includes continuous integration and continuous deployment. In continuous integration, when the developer submits the code to the trunk, the submitted code is verified through compilation and automated testing processes. In continuous deployment, the submitted code is automatically deployed to the target server.

2. The method according to claim 1, characterized in that The step of obtaining the program code of the application program through the pipeline and the storage address includes: After starting the pipeline, calling the target script, wherein the target script is an automatic execution script; The storage address is accessed through the target script, and the program code of the application is pulled from the storage address.

3. The method according to claim 1, characterized in that The testing of the program code comprises: Checking the integrity of the program code; When the program code is complete, test cases are used to perform automated testing on the program code.

4. The method according to claim 1, characterized in that When the program code test passes, deploying the program code to the target server according to the target IP address of the target server and in accordance with the deployment method includes: Obtaining an IP address of each server in a server set for deploying an application, wherein the server set includes the target server; Comparing the target IP address with each of the IP addresses; In the case that any one of the IP addresses is the same as the target IP address, the server corresponding to the IP address that is the same as the target IP address is determined as the target server.

5. The method according to claim 1, characterized in that When the program code test passes, deploying the program code to the target server according to the target IP address of the target server and in accordance with the deployment method includes: When the target server is a virtual machine or a physical machine, the program code is automatically published to the target server through a target script; In the case where the target server is a server in a cluster, the compiled program code is built into an image, the built image is pushed to an image warehouse, and the image is published to the target server through the target script.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the program code passes the test, the program code is compiled.

7. The method according to claim 6, characterized in that The application service information also includes a compilation template, and when the program code test passes, compiling the program code includes: The program code is compiled according to the compilation template to obtain the compiled program code, wherein different compilation templates correspond to different language types.

8. An application deployment device, characterized in that: include: A first acquisition module is used to acquire application service information registered by the application to be deployed, wherein the application service information includes the storage address of the application in the storage warehouse, the deployment method of the application, and the target IP address of the target server to be deployed; The calling module is used to call the pipeline interface and start the pipeline; A second acquisition module, used for acquiring the program code of the application program through the pipeline and the storage address; A test module, used for testing the program code; A deployment module, used for deploying the compiled program code to the target server according to the target IP address of the target server and in accordance with the deployment method if the program code test passes; Among them, the pipeline includes continuous integration and continuous deployment. In continuous integration, when the developer submits the code to the trunk, the submitted code is verified through compilation and automated testing processes. In continuous deployment, the submitted code is automatically deployed to the target server.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Application publishing system and method applied to heterogeneous multi-cloud environment

    CN111580832A