CN109086051B - Application component deployment method and device and computer storage medium - Google Patents
Application component deployment method and device and computer storage medium Download PDFInfo
- Publication number
- CN109086051B CN109086051B CN201810699030.4A CN201810699030A CN109086051B CN 109086051 B CN109086051 B CN 109086051B CN 201810699030 A CN201810699030 A CN 201810699030A CN 109086051 B CN109086051 B CN 109086051B
- Authority
- CN
- China
- Prior art keywords
- deployment
- action
- application
- application component
- deployed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses an application component deployment method, an application component deployment device and a computer storage medium, relates to the technical field of application development, and mainly aims to improve the efficiency and accuracy of application component deployment. The method comprises the following steps: receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed; acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier; analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component. The invention is suitable for the deployment of the application components.
Description
Technical Field
The invention relates to the technical field of application development, in particular to an application component deployment method, an application component deployment device and a computer storage medium.
Background
With the continuous development and progress of information technology, in order to meet the increasing demand of people, the application program needs to continuously update functions, so that application developers are required to continuously develop application components. After an application developer has developed the code of an application component or has modified a piece of code of an application component, the application developer usually needs to deploy the application component and deploy the application component.
Currently, application components are typically deployed manually by a technician. However, the deployment of the application components requires a lot of configuration information, different teams may collaboratively develop different application components for one application program, and the development language and development environment of each application component are different, and the deployment modes of the application components are not different, and with the rise of the micro-service framework, tens or even hundreds of application components may need to be deployed at the top layer of one application program, and the deployment rhythm of the application components cannot be controlled by deploying the application components in a manual mode, so that the deployment speed of the application components is slow, and errors and risks in the deployment of the application components are easily increased, thereby resulting in low deployment efficiency and accuracy of the application components.
Disclosure of Invention
The invention provides an application component deployment method, an application component deployment device and a computer storage medium, which mainly aim to automatically complete application component deployment, realize standardization of an application component deployment process, accelerate deployment speed, control deployment rhythm, reduce deployment complexity and reduce errors and risks of manual operation, thereby improving the efficiency and accuracy of application component deployment.
According to a first aspect of the present invention, there is provided an application component deployment method, comprising:
receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed;
acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier;
analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
According to a second aspect of the present invention, there is provided an application component deployment apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an application component deployment instruction, and the deployment instruction comprises an application component identifier of an application component to be deployed;
the acquisition unit is used for acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier;
the analysis unit is used for analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
and the deployment unit is used for executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed;
acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier;
analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
According to a fourth aspect of the present invention, there is provided an application component deployment apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:
receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed;
acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier;
analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
Compared with the prior art that the application components are deployed in a manual mode, the application component deployment method, the application component deployment device and the computer storage medium can receive an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of the application component to be deployed; the file to be deployed and the deployment configuration file of the application component can be obtained according to the application component identifier, and meanwhile, the deployment configuration file can be analyzed to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path to complete the deployment of the application component, so that the deployment of the application component can be automatically completed, the standardization of a deployment flow of the application component can be realized, the deployment speed can be accelerated, the deployment rhythm can be controlled, the deployment complexity can be reduced, the errors and risks of manual operation can be reduced, and the deployment efficiency and accuracy of the application component can be improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flowchart illustrating an application component deployment method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another application component deployment method provided by the embodiment of the invention;
fig. 3 is a schematic structural diagram of an application component deployment apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another application component deployment apparatus provided in the embodiment of the present invention;
fig. 5 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
As background, application components are currently deployed manually, typically by a technician. However, the deployment of the application components requires a lot of configuration information, different teams may collaboratively develop different application components for one application program, and the development language and development environment of each application component are different, and the deployment modes of the application components are not different, and with the rise of the micro-service framework, tens or even hundreds of application components may need to be deployed at the top layer of one application program, and the deployment rhythm of the application components cannot be controlled by deploying the application components in a manual mode, so that the deployment speed of the application components is slow, and errors and risks in the deployment of the application components are easily increased, thereby resulting in low deployment efficiency and accuracy of the application components.
In order to solve the above problem, an embodiment of the present invention provides an application component deployment method, as shown in fig. 1, where the method includes:
101. an application component deployment instruction is received.
Wherein the deployment instruction comprises an application component identification of the application component to be deployed. The application component identifier may be a name of the application component or a unique code of the application component, which is not limited in the embodiment of the present invention. The deployment instruction may be received by the execution subject application component deployment apparatus according to the embodiment of the present invention when a technician clicks or triggers a deployment button or key.
102. And acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier.
It should be noted that the deployment configuration file may be pre-written for the application component by a technician, and the deployment configuration file may define contents describing two parts: and the standard deployment execution action of the application component and the deployment path corresponding to the file to be deployed. Different application components correspond to different deployment configuration files, but the different deployment configuration files all describe the contents of the two parts, the standard deployment execution actions of the different application components are the same, each execution action in the standard deployment execution actions can be composed of a plurality of commands, each command can be represented by a command line execution statement, the command line execution statement can be a shell execution statement or other execution statements, and each command in each execution action can be determined according to the actual situation of the application component. The standard deployment execution actions may be defined with 5 execution actions: the application stopping action, the pre-deployment action, the post-deployment action, the application starting action, and the application verifying action, that is, for different application components, the deployment configuration file may all describe the above 5 execution actions. The deployment path may be a path for deploying the file to be deployed and installing the file to be deployed on the server to be deployed.
The deployment configuration file may be written in json text format, or may be written in yaml or xml text format, which is not limited in the embodiment of the present invention. For example, when the deployment configuration file is written in json text format, the application stop action may be: "app _ stop action", the pre-deployment action may be: "before _ install action", the post-deployment action may be: the "after _ instance action", the application start action may be: "app _ start action", the application verification action may be: "health _ check action". The deployment path may be: "/app", "/etc", "/var/log", etc.
103. And analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed.
In the embodiment of the present invention, the application stop action may specify to stop the application component or to delete the currently installed application component in the deployment preparation process, and the pre-deployment action may specify to execute a pre-installation action, such as creating a backup of the version of the current application component, checking a dependent resource package, and the like; the post-deployment action may specify a post-installation file deployment action, such as configuring an application component, changing certain related file permissions, and the like; the application launch action may specify launching an application component to perform an action; and the application verification action may specify verifying whether the application component deployment was successful.
104. And executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
For the embodiment of the present invention, if all the standard deployment execution actions are executed, and the file to be deployed is deployed to the server to be deployed according to the deployment path, the deployment of the application component is completed. If one of the above 5 execution actions does not exist in the standard deployment execution action, or if an execution action with execution failure exists in the standard deployment execution action, ending the application component deployment flow.
Compared with the application component deployment in a manual mode at present, the application component deployment method provided by the embodiment of the invention can receive an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed; the file to be deployed and the deployment configuration file of the application component can be obtained according to the application component identifier, and meanwhile, the deployment configuration file can be analyzed to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path to complete the deployment of the application component, so that the deployment of the application component can be automatically completed, the standardization of a deployment flow of the application component can be realized, the deployment speed can be accelerated, the deployment rhythm can be controlled, the deployment complexity can be reduced, the errors and risks of manual operation can be reduced, and the deployment efficiency and accuracy of the application component can be improved.
Further, in order to better describe the process of deploying the application components, as a refinement and extension to the foregoing embodiment, an embodiment of the present invention provides another method for deploying the application components, as shown in fig. 2, where the method includes:
201. an application component deployment instruction is received.
Wherein the deployment instruction comprises an application component identification of the application component to be deployed.
202. And acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier.
For the embodiment of the present invention, in order to integrate the file to be deployed and the deployment configuration file of the application component, simplify management of the file to be deployed and the deployment configuration file of the application component, avoid a problem that the file to be deployed and the deployment configuration file need to correspond to each other, and avoid additional management of the deployment configuration file, the step 202 may specifically include: downloading the deployment installation package of the application component from a preset package storage server according to the application component identifier, wherein the preset package storage server stores deployment installation packages corresponding to different application components; and analyzing the file to be deployed and the deployment configuration file of the application component from the deployment installation package. The deployment installation package may be obtained by packaging the file to be deployed and the deployment configuration file after a technician writes the deployment configuration file. Specifically, the deployment installation package of the application component may be downloaded to the server to be deployed, the deployment installation package may be a general compressed file package, the compressible file package may be a zip compressed file package or a tar compressed file package, and the deployment installation package exists in the form of a compressed file package, and is convenient to store, transmit, distribute, and the like.
In addition, in order to save the storage space of the server to be deployed and improve the deployment efficiency of the application components, the method further comprises the following steps: storing the file to be deployed and the deployment configuration file of the application component into a local temporary storage file; and after receiving the return value of the application component deployment completion, deleting the file to be deployed and the deployment configuration file of the application component in the temporary storage file. The return value of the application component deployment completion may be 0, and when the return value of the application component deployment is received to be 0, it is indicated that the application component deployment is completed, and the file to be deployed and the deployment configuration file of the application component are deleted from the temporary storage file.
203. And analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed.
In an embodiment of the present invention, the standard deployment execution action may be defined with 5 execution actions: an application stop action, a pre-deployment action, a post-deployment action, an application start action, and an application verification action. The application stop action may include an application stop command print command and an application stop command; specifically, the dependent resource package download command print command may be: "echo application stop", the application stop command may be: sh ""./bin/stop ". The pre-deployment action may include a pre-deployment action print command and an application component pre-installation command, for example, the application component pre-installation command may be a current version application component backup creation command, a dependent resource package detection command, and the like, and specifically, the pre-deployment action print command may be: "echo before _ install action", the application component preinstallation command may be: "./bin/backup. The post-deployment action may include a post-deployment action print command and an application component related authority configuration or change command, and specifically, the post-deployment action print command may be: "echo after _ install action", the application component dependent permission configuration or change command may be: "chmod a + xbin-R". The application starting action may include an application starting action print command and an application component starting command, and specifically, the application starting action print command may be: "echo application start action", the application component start command may be: sh ""./bin/start ". The application verification action may include the application verification action print command and the application component deployment verification command, and specifically, the application verification action print command may be: "an echo application health check action", the application component deployment verification command may be: pid ".
204. And executing the application stopping action in the standard deployment executing action, and detecting whether the execution is completed. If the execution is completed, go to step 205; if the execution fails, step 210 is performed.
For the embodiment of the present invention, if the application stopping action includes an installed application component stopping command, the step 204 may specifically include: and executing the application stopping action to execute the installed application component stopping command, stop the application component or delete the currently installed application component in the deployment preparation process. In addition, if the application stop action may include an application stop command print command and an application stop command, step 204 may specifically include: executing the application stop action to firstly execute an application stop command printing command and print and output a piece of information application stop.action; and then executing the installed application component stopping command to stop the application component or delete the currently installed application component in the deployment preparation process.
It should be noted that, executing the application stop action may sequentially execute each defined command, specifically, execute each command line execution statement, after any command line execution statement is executed, a corresponding return value may be 0, and after each command in the application stop action is executed, the return value of each command may be received, that is, whether the application stop action is executed or not may be determined by detecting whether the return value corresponding to the application stop action is 0. If the return values of all commands of the application stopping action are 0, determining that the application stopping action is executed; and if the return value of each command of the application stopping action is not 0, determining that the application stopping action fails to be executed, and ending the deployment process of the application component. In addition, if there is no application stopping action in the standard deployment execution action, the deployment flow of the application component is also ended.
205. And executing the pre-deployment action in the standard deployment execution actions, and detecting whether the execution is completed. If the execution is completed, go to step 206; if the execution fails, step 210 is performed.
For the embodiment of the present invention, if the pre-deployment action includes an application component pre-installation command, the step 205 may specifically include: and executing the pre-deployment action to execute the application component pre-installation command and pre-install the application component. In addition, if the pre-deployment action may include a pre-deployment action print command and an application component pre-installation command, the step 205 may specifically include: executing the pre-deployment action to firstly execute a pre-deployment action printing command and print and output a piece of information before instance action; and then executing the application component pre-installation command to pre-install the application component, creating backup of the application component of the previous version, detecting a dependent resource package and the like.
Similarly, executing the pre-deployment action may sequentially execute each defined command, specifically, execute each command line execution statement, where after the execution of any command line execution statement is completed, the corresponding return value may be 0, and after each command in the pre-deployment action is completed, the return value of each command may be received, that is, whether the execution of the pre-deployment action is completed may be determined by detecting whether the return value corresponding to the pre-deployment action is 0. If the return values of all commands of the pre-deployment action are 0, determining that the execution of the pre-deployment action is finished; and if the return value of each command of the pre-deployment action is not 0, determining that the pre-deployment action fails to execute, and ending the deployment process of the application component. In addition, if there is no pre-deployment action in the standard deployment execution actions, the deployment flow of the application component is also ended.
206. And deploying the file to be deployed to a server to be deployed according to the deployment path, executing the action after deployment, and detecting whether the execution is finished. If the execution is completed, go to step 207; if the execution fails, step 210 is performed.
For the embodiment of the present invention, the step of deploying the file to be deployed to the server to be deployed according to the deployment path may specifically include: copying the file to be deployed to the deployment path to complete the deployment of the file to be deployed to the server to be deployed, wherein the deployment path is a deployment path of the file to be deployed on the server to be deployed. For example, if the file to be deployed is an app.jar file, the app.jar file may be copied to the app path of the server to be deployed; if the file to be deployed is a config file, copying the config file to a/etc path of the server to be deployed; if the file to be deployed is a bin file, the bin file can be copied to the app path of the server to be deployed; if the file to be deployed is a log file, the log file can be copied to a/var/log path of the server to be deployed, and the like.
In this embodiment of the present invention, if the post-deployment action includes an application component-related permission configuration or change command, the step 206 may specifically include: and executing the post-deployment action to execute the command for configuring or changing the related authority of the application component and configure or change the related authority of the application component. In addition, if the post-deployment action includes a post-deployment action print command and an application component related authority configuration or change command, the step 206 may specifically include: executing the post-deployment action to firstly execute a post-deployment action printing command and print and output an information after _ install action; and then executing the command for configuring or changing the related authority of the application component, and configuring or changing the related authority of the application component.
Similarly, executing the post-deployment action may sequentially execute each defined command, specifically, execute each command line execution statement, where after the execution of any command line execution statement is completed, the corresponding return value may be 0, and after each command in the post-deployment action is completed, the return value of each command may be received, that is, whether the execution of the post-deployment action is completed may be determined by detecting whether the return value corresponding to the post-deployment action is 0. If the return values of all commands of the application stopping action are 0, determining that the action execution is finished after the deployment; and if the return value of each command of the post-deployment action is not 0, determining that the post-deployment action fails to be executed, and ending the deployment process of the application component. In addition, if there is no post-deployment action in the standard deployment execution actions, the deployment flow of the application component is also ended.
207. And executing the application starting action in the standard deployment execution action, and detecting whether the execution is completed. If the execution is completed, go to step 208; if the execution fails, step 210 is performed.
For the embodiment of the present invention, if the application starting action includes an application component starting command, step 207 may specifically include: and executing the application starting action to execute the application component starting command and start the application component. In addition, if the application start action includes an application start action print command and an application component start command, step 207 may specifically include: executing the application starting action to firstly execute an application starting action printing command and print and output an information application starting action; and then executing the application component starting command to start the application component.
Similarly, executing the application starting action may sequentially execute the defined commands, specifically, execute the command line execution statements, after any command line execution statement is executed, the corresponding return value may be 0, and after each command in the application starting action is executed, the return value of each command may be received, that is, whether the application starting action is executed or not may be determined by detecting whether the return value corresponding to the application starting action is 0. If the return values of all commands of the application starting action are 0, determining that the application starting action is executed; and if the return value of each command of the application starting action is not 0, determining that the application starting action fails to be executed, and ending the deployment process of the application component. In addition, if the standard deployment execution action does not have the application starting action, the deployment process of the application component is also ended.
208. And executing the application verification action in the standard deployment execution action, and detecting whether the execution is completed. If the execution is completed, go to step 209; if the execution fails, step 210 is performed.
For the embodiment of the present invention, if the application verification action includes an application component deployment verification command, the step 208 may specifically include: and executing the application verification action to execute the application component deployment verification command to verify the application component deployment. In addition, if the application verification action includes an application verification action print command and an application component deployment verification command, the step 208 may specifically include: executing the application verification action to firstly execute an application verification action printing command and print and output an information echo application health check action; and then executing the application component deployment verification command to verify the deployment of the application component.
Similarly, executing the application verification action may sequentially execute the defined commands, specifically, execute the command line execution statements, where after the execution of any command line execution statement is completed, the corresponding return value may be 0, and after each command in the application verification action is completed, the return value of each command may be received, that is, whether the execution of the application verification action is completed may be determined by detecting whether the return value corresponding to the application verification action is 0. If the return values of all commands of the application verification action are 0, determining that the application verification action is executed; and if the return value of each command of the application verification action is not 0, determining that the application verification action fails to be executed, and ending the deployment process of the application component. In addition, if the standard deployment execution action does not have the application verification action, the deployment process of the application component is also ended.
209. Determining to complete the deployment flow of the application component.
210. And ending the deployment process of the application component.
Compared with the prior art that the application component is deployed in a manual mode, the application component deployment method provided by the embodiment of the invention can receive an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of the application component to be deployed; the file to be deployed and the deployment configuration file of the application component can be obtained according to the application component identifier, and meanwhile, the deployment configuration file can be analyzed to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path to complete the deployment of the application component, so that the deployment of the application component can be automatically completed, the standardization of a deployment flow of the application component can be realized, the deployment speed can be accelerated, the deployment rhythm can be controlled, the deployment complexity can be reduced, the errors and risks of manual operation can be reduced, and the deployment efficiency and accuracy of the application component can be improved.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides an application component deployment apparatus, as shown in fig. 3, where the apparatus includes: a receiving unit 31, an acquisition unit 32 and an analysis unit 33 and a deployment unit 34.
The receiving unit 31 may be configured to receive an application component deployment instruction, where the deployment instruction includes an application component identifier of an application component to be deployed. The receiving unit 31 is a main functional module in the present apparatus for receiving an application component deployment instruction.
The obtaining unit 32 may be configured to obtain the file to be deployed and the deployment configuration file of the application component according to the application component identifier. The obtaining unit 32 is a main function module in the present apparatus that obtains the file to be deployed and the deployment configuration file of the application component according to the application component identifier.
The parsing unit 33 may be configured to parse the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed. The analysis unit 33 is a main function module that analyzes the deployment configuration file in the device to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed.
The deployment unit 34 may be configured to execute an application stop action, a pre-deployment action, a post-deployment action, an application start action, and an application verification action in the standard deployment execution action, and deploy the file to be deployed to the server to be deployed according to the deployment path, so as to complete the deployment of the application component. The deployment unit 35 is configured to execute an application stop action, a pre-deployment action, a post-deployment action, an application start action, and an application verification action in the standard deployment execution action, and deploy the file to be deployed to the server to be deployed according to the deployment path to complete the deployment of the application component.
The deployment unit 34 may be specifically configured to execute the application stop action; if the application stopping action execution fails, ending the deployment process of the application component; if the application stops the execution of the action and completes, executing the pre-deployment action; if the pre-deployment action execution fails, ending the deployment process of the application component; if the pre-deployment action is executed, deploying the file to be deployed to a server to be deployed according to the deployment path, and executing a post-deployment action; if the post-deployment action execution fails, ending the deployment process of the application component; if the post-deployment action is completed, executing the application starting action; if the application starting action fails to be executed, ending the deployment process of the application component; if the application starting action is executed, executing the application verification action; if the application verification action fails to be executed, ending the deployment process of the application component; and if the execution of the application verification action is completed, determining that the deployment process of the application component is completed.
For the embodiment of the present invention, in order to detect whether each of the standard deployment execution actions is executed completely, the apparatus further includes: a detection unit 35 and a determination unit 36, as shown in fig. 4.
The detecting unit 35 may be configured to detect whether execution return values corresponding to the application stopping action, the pre-deployment action, the post-deployment action, the application starting action, and the application verifying action are respectively non-0.
The determining unit 36 may be configured to determine that the application stopping action, the pre-deployment action, the post-deployment action, the application starting action, and the application verifying action are executed if the determination result is 0; and if the execution return value is not 0, determining that the execution action corresponding to the execution return value is not 0 fails to be executed.
The deployment unit 34 may be specifically configured to execute the application stop action to execute an installed application component stop command included in the application stop action; executing the pre-deployment action to execute an application component pre-installation command included in the pre-deployment action; executing the post-deployment action, and configuring or changing commands by using the related authority of the application components included in the post-deployment action; executing the application starting action to execute an application component starting command included in the application starting action; executing the application verification action to perform the application verification action includes an application component deployment verification command.
For the embodiment of the present invention, in order to integrate the file to be deployed and the deployment configuration file of the application component, simplify management of the file to be deployed and the deployment configuration file of the application component, and avoid a problem that the source file to be deployed and the deployment configuration file need to correspond to each other, the obtaining unit 32 may be specifically configured to download the deployment installation package of the application component from a preset package storage server according to the application component identifier, where the preset package storage server stores deployment installation packages corresponding to different application components; and analyzing the file to be deployed and the deployment configuration file of the application component from the deployment installation package.
In addition, the deployment unit 34 may be specifically configured to copy the file to be deployed to the deployment path to complete the deployment of the file to be deployed to the server to be deployed, where the deployment path is a deployment path of the file to be deployed on the server to be deployed.
For the embodiment of the present invention, in order to save the storage space of the server to be deployed and improve the deployment efficiency of the application component, the apparatus further includes: a storage unit 37 and a deletion unit 38.
The storage unit 37 may be configured to store the file to be deployed and the deployment configuration file of the application component in a local temporary storage file. The storage unit 37 is a main functional module in the present apparatus that stores the file to be deployed and the deployment configuration file of the application component in a local temporary storage file.
The deleting unit 38 may be configured to delete the file to be deployed and the deployment configuration file of the application component from the temporary storage file after receiving the return value indicating that the deployment of the application component is completed.
It should be noted that other corresponding descriptions of the functional modules related to the application component deployment apparatus provided in the embodiment of the present invention may refer to the corresponding description of the method shown in fig. 1, and are not described herein again.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps: receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed; acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier; analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component.
Based on the above embodiments of the method shown in fig. 1 and the application component deployment apparatus shown in fig. 3, an embodiment of the present invention further provides an entity structure diagram of a computer device, as shown in fig. 5, where the computer device includes: a processor 41, a memory 42, and a computer program stored on the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43 such that when the processor 41 executes the program, the following steps are performed: receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed; acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier; analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path so as to complete the deployment of the application component. The computer device further includes: a bus 43 configured to couple the processor 41 and the memory 42.
By the technical scheme, the application component deployment instruction can be received, and the deployment instruction comprises the application component identification of the application component to be deployed; the file to be deployed and the deployment configuration file of the application component can be obtained according to the application component identifier, and meanwhile, the deployment configuration file can be analyzed to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed; and executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path to complete the deployment of the application component, so that the deployment of the application component can be automatically completed, the standardization of a deployment flow of the application component can be realized, the deployment speed can be accelerated, the deployment rhythm can be controlled, the deployment complexity can be reduced, the errors and risks of manual operation can be reduced, and the deployment efficiency and accuracy of the application component can be improved.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
1. An application component deployment method, comprising:
receiving an application component deployment instruction, wherein the deployment instruction comprises an application component identifier of an application component to be deployed;
acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier, wherein the file to be deployed and the deployment configuration file are obtained by downloading a deployment installation package from a preset package storage server and analyzing;
analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment executing actions, and deploying the file to be deployed to a server to be deployed according to the deployment path so as to complete the deployment of the application component;
wherein, the executing of the application stopping action, the pre-deployment action, the post-deployment action, the application starting action and the application verifying action in the standard deployment executing action are executed in sequence, so as to execute an installed application component stopping command included in the application stopping action, an application component pre-installation command included in the pre-deployment action, an application component related authority configuration or change command included in the post-deployment action, an application component starting command included in the application starting action and an application verifying action in sequence;
the method further comprises the following steps:
detecting whether execution return values corresponding to the application stopping action, the pre-deployment action, the post-deployment action, the application starting action and the application verifying action are respectively non-0;
if the number of the application stopping actions is 0, determining that the application stopping actions, the pre-deployment actions, the post-deployment actions, the application starting actions and the application verification actions are executed;
and if the execution return value is not 0, determining that the execution action corresponding to the execution return value is not 0 fails to be executed.
2. The method according to claim 1, wherein the executing of the application stop action, the pre-deployment action, the post-deployment action, the application start action, and the application verification action in the standard deployment execution actions, and deploying the file to be deployed to the server to be deployed according to the deployment path to complete application component deployment comprises:
executing the application stop action;
if the application stopping action execution fails, ending the deployment process of the application component;
if the application stops the execution of the action and completes, executing the pre-deployment action;
if the pre-deployment action execution fails, ending the deployment process of the application component;
if the pre-deployment action is executed, deploying the file to be deployed to a server to be deployed according to the deployment path, and executing a post-deployment action;
if the post-deployment action execution fails, ending the deployment process of the application component;
if the post-deployment action is completed, executing the application starting action;
if the application starting action fails to be executed, ending the deployment process of the application component;
if the application starting action is executed, executing the application verification action;
if the application verification action fails to be executed, ending the deployment process of the application component;
and if the execution of the application verification action is completed, determining that the deployment process of the application component is completed.
3. The method according to claim 1, wherein the obtaining the file to be deployed and the deployment configuration file of the application component according to the application component identifier comprises:
downloading the deployment installation package of the application component from a preset package storage server according to the application component identifier, wherein the preset package storage server stores deployment installation packages corresponding to different application components;
and analyzing the file to be deployed and the deployment configuration file of the application component from the deployment installation package.
4. The method according to claim 1, wherein the deploying the file to be deployed to a server to be deployed according to the deployment path comprises:
copying the file to be deployed to the deployment path to complete the deployment of the file to be deployed to the server to be deployed, wherein the deployment path is a deployment path of the file to be deployed on the server to be deployed.
5. The method according to claim 1, wherein after obtaining the file to be deployed and the deployment configuration file of the application component according to the application component identifier, the method further comprises:
storing the file to be deployed and the deployment configuration file of the application component into a local temporary storage file;
and after receiving the return value of the application component deployment completion, deleting the file to be deployed and the deployment configuration file of the application component in the temporary storage file.
6. An application component deployment apparatus, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an application component deployment instruction, and the deployment instruction comprises an application component identifier of an application component to be deployed;
the acquiring unit is used for acquiring a file to be deployed and a deployment configuration file of the application component according to the application component identifier, wherein the file to be deployed and the deployment configuration file are obtained by downloading a deployment installation package from a preset package storage server and analyzing the deployment installation package;
the analysis unit is used for analyzing the deployment configuration file to obtain a standard deployment execution action of the application component and a deployment path corresponding to the file to be deployed;
the deployment unit is used for executing an application stopping action, a pre-deployment action, a post-deployment action, an application starting action and an application verification action in the standard deployment execution actions, and deploying the file to be deployed to a server to be deployed according to the deployment path so as to complete the deployment of the application component;
wherein, the executing of the application stopping action, the pre-deployment action, the post-deployment action, the application starting action and the application verifying action in the standard deployment executing action are executed in sequence, so as to execute an installed application component stopping command included in the application stopping action, an application component pre-installation command included in the pre-deployment action, an application component related authority configuration or change command included in the post-deployment action, an application component starting command included in the application starting action and an application verifying action in sequence;
the device further comprises:
a detecting unit, configured to detect whether execution return values corresponding to the application stop action, the pre-deployment action, the post-deployment action, the application start action, and the application verification action are respectively non-0;
a determining unit, configured to determine that the application stopping action, the pre-deployment action, the post-deployment action, the application starting action, and the application verifying action are executed if the number of the application stopping actions is 0; and if the execution return value is not 0, determining that the execution action corresponding to the execution return value is not 0 fails to be executed.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 5 are implemented when the computer program is executed by the processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810699030.4A CN109086051B (en) | 2018-06-29 | 2018-06-29 | Application component deployment method and device and computer storage medium |
PCT/CN2018/111669 WO2020000811A1 (en) | 2018-06-29 | 2018-10-24 | Application component deployment method and apparatus, and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810699030.4A CN109086051B (en) | 2018-06-29 | 2018-06-29 | Application component deployment method and device and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109086051A CN109086051A (en) | 2018-12-25 |
CN109086051B true CN109086051B (en) | 2022-03-25 |
Family
ID=64834838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810699030.4A Active CN109086051B (en) | 2018-06-29 | 2018-06-29 | Application component deployment method and device and computer storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109086051B (en) |
WO (1) | WO2020000811A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109871208B (en) * | 2019-01-04 | 2023-10-17 | 平安科技(深圳)有限公司 | Software system generation method, device, computer readable storage medium and server |
CN112148342A (en) * | 2019-06-27 | 2020-12-29 | 北京达佳互联信息技术有限公司 | Component configuration method and device, electronic equipment and storage medium |
CN111162953B (en) * | 2019-12-31 | 2023-04-28 | 四川省公安科研中心 | Data processing method, system upgrading method and server |
CN113849192A (en) * | 2020-06-28 | 2021-12-28 | 中移智行网络科技有限公司 | Big data platform deployment method and device, storage medium and computer equipment |
CN111913721B (en) * | 2020-07-16 | 2024-06-11 | 中国民航信息网络股份有限公司 | Automatic deployment method, device, equipment and storage medium |
CN114374677B (en) * | 2020-10-15 | 2023-12-26 | 中国移动通信集团浙江有限公司 | Cross-platform online publishing method and device, computing equipment and storage medium |
CN112698839B (en) * | 2020-12-30 | 2024-04-12 | 深圳前海微众银行股份有限公司 | Data center node deployment method, device and system and computer storage medium |
CN113805935A (en) * | 2021-09-16 | 2021-12-17 | 平安健康保险股份有限公司 | Code module issuing method and device, computer equipment and readable storage medium |
CN118378237B (en) * | 2024-04-26 | 2024-10-18 | 北京京航计算通讯研究所 | Dynamic authentication method for microservice component based on development platform |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102360308A (en) * | 2011-09-29 | 2012-02-22 | 用友软件股份有限公司 | Distributed deployment system and method of components |
CN102404381A (en) * | 2011-09-02 | 2012-04-04 | 西安交通大学 | Software deployment system and deployment method based on workflow in cloud computing environment |
CN104615466A (en) * | 2015-02-05 | 2015-05-13 | 广州亦云信息技术有限公司 | Cloud platform deployment method and system |
CN105227379A (en) * | 2015-10-29 | 2016-01-06 | 国家电网公司 | A kind of centralized monitor for java web application and method for early warning |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6892382B1 (en) * | 1999-05-06 | 2005-05-10 | Sun Microsystems, Inc. | Method and apparatus for implementing deployment descriptors in an enterprise environment |
CN1811702B (en) * | 2004-08-16 | 2010-08-25 | 国际商业机器公司 | System and method for developing portal applications and automatically deploying them into a portal server application |
US20160246582A1 (en) * | 2015-02-25 | 2016-08-25 | Red Hat, Inc. | Generic Semantic Configuration Service |
-
2018
- 2018-06-29 CN CN201810699030.4A patent/CN109086051B/en active Active
- 2018-10-24 WO PCT/CN2018/111669 patent/WO2020000811A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102404381A (en) * | 2011-09-02 | 2012-04-04 | 西安交通大学 | Software deployment system and deployment method based on workflow in cloud computing environment |
CN102360308A (en) * | 2011-09-29 | 2012-02-22 | 用友软件股份有限公司 | Distributed deployment system and method of components |
CN104615466A (en) * | 2015-02-05 | 2015-05-13 | 广州亦云信息技术有限公司 | Cloud platform deployment method and system |
CN105227379A (en) * | 2015-10-29 | 2016-01-06 | 国家电网公司 | A kind of centralized monitor for java web application and method for early warning |
Also Published As
Publication number | Publication date |
---|---|
WO2020000811A1 (en) | 2020-01-02 |
CN109086051A (en) | 2018-12-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109086051B (en) | Application component deployment method and device and computer storage medium | |
US10114637B1 (en) | Automatically updating a shared project build platform | |
US10579966B1 (en) | Adapting a shared project build platform to a developer plugin | |
US8978015B2 (en) | Self validating applications | |
CN106708740B (en) | Script testing method and device | |
JP6217277B2 (en) | Software development method and system therefor | |
US11748245B2 (en) | Object-oriented regression-candidate filter | |
US20190073292A1 (en) | State machine software tester | |
CN102541596A (en) | Operating system upgrading method and device | |
CN111324522A (en) | Automatic test system and method | |
US10514898B2 (en) | Method and system to develop, deploy, test, and manage platform-independent software | |
WO2017041499A1 (en) | Software upgrade method and system, and computer-readable storage medium | |
US10866803B2 (en) | Generating interaction libraries | |
CN109683905A (en) | A kind of system method for automatically releasing | |
EP4036716B1 (en) | Method and device for acquiring mirror image file | |
US20080172579A1 (en) | Test Device For Verifying A Batch Processing | |
CN112363731A (en) | Application automation deployment method and device and computer readable storage medium | |
CN114546819A (en) | Code processing method and device, electronic equipment and readable medium | |
CN108509346B (en) | Dual-system BIOS continuous integration platform and method | |
US20160335068A1 (en) | Checks for software extensions | |
US10599424B2 (en) | Committed program-code management | |
WO2020000810A1 (en) | Application component construction packaging method and device, and computer storage medium | |
CN111796863A (en) | Cross-environment project version management method | |
Khuvis et al. | A continuous integration-based framework for software management | |
CN113127022A (en) | Automatic code updating method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |