Method and device for deploying software
1. A method for deploying software, comprising:
acquiring a software package to be deployed, and selecting one or more configuration files in the software package;
extracting configuration information of the software package from the one or more configuration files;
generating a deployment file for the software package based on the configuration information and a preset deployment file template;
and deploying the software package by utilizing the deployment file.
2. The method of claim 1, wherein selecting one or more configuration files in the software package comprises:
selecting a first configuration file associated with the software configuration information; and
a deployment configuration file associated with the software deployment information is selected to generate a second configuration file based on the deployment configuration file.
3. The method of claim 1,
further comprising: acquiring a source code to be deployed;
the acquiring the software package to be deployed includes: and compiling the source code by using the custom plug-in to generate a software package to be deployed.
4. The method of claim 3,
the self-defined plug-in is defined with attribute information;
further comprising: when the source code is compiled by using the custom plug-in, acquiring an attribute value corresponding to the attribute information from the source code through the custom plug-in, generating a first configuration file related to software configuration information based on the attribute value, and adding the first configuration file to the software package.
5. The method of claim 2,
the extracting the configuration information of the software package comprises:
acquiring a software identifier from the first configuration file;
and determining the software configuration information contained in the configuration information based on the software identification.
6. The method of claim 5,
the deployment file template comprises one or more first deployment files, wherein the first deployment files are related to the first configuration file;
the generating a deployment file for the software package includes: modifying the first deployment file based on the software configuration information obtained from the first configuration file.
7. The method of claim 2,
the extracting the configuration information of the software package comprises:
obtaining a software type from the first configuration file;
determining software deployment information contained in the configuration information based on the software type; and generating a second configuration file based on the software deployment information.
8. The method of claim 7,
the deployment file template comprises one or more second deployment files, wherein the second deployment files are related to the second configuration files;
the generating a deployment file for the software package includes:
determining a third deployment file from the one or more second deployment files according to the software type;
modifying the third deployment file using the software deployment information obtained from the second configuration file.
9. The method of claim 1,
further comprising: updating the deployment file template based on the deployment file;
alternatively, the first and second electrodes may be,
further comprising: generating a new deployment file template based on the deployment file and the deployment file template;
and selecting a deployment file template matched with the version information of the software package from the deployment file template and the new deployment file template.
10. The method of claim 1,
further comprising: a deployment tool is arranged;
the deploying the software package comprises:
in the event that a deployment instruction is received for the software package,
and processing the deployment instruction by using the deployment tool, and deploying the software package based on the processed result and the deployment file.
11. The method of claim 10, wherein processing the deployment instructions with the deployment tool and deploying the software package based on the processed results and the deployment file comprises:
analyzing parameter values contained in the deployment instruction by using the deployment tool;
when the parameter value is inconsistent with the value of the configuration information included in the deployment file:
and updating the value of the configuration information included in the deployment file according to the parameter value, and deploying the software package based on the updated deployment file.
12. An apparatus for deploying software, comprising: the method comprises the steps of obtaining a configuration file module, generating a deployment file module and a deployment software module; wherein the content of the first and second substances,
the configuration file acquisition module is used for acquiring a software package to be deployed and selecting one or more configuration files in the software package;
the deployment file generation module is used for extracting the configuration information of the software package from the one or more configuration files; generating a deployment file for the software package based on the configuration information and a preset deployment file template;
the deployment software module is used for deploying the software package by using the deployment file.
13. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-11.
14. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-11.
Background
With the more complex architecture of the internet application, the complexity of maintaining the internet application system is higher, wherein the system maintenance includes software deployment, data backup, troubleshooting, and the like, and the software deployment usually adopts a containerization deployment mode and often requires a large amount of labor cost and time cost.
At present, when software deployment is performed in a containerized deployment manner, configuration files required for deployment need to be configured manually, that is, for each software package to be deployed, configuration files need to be processed manually. When the number of software packages is large, the problems of large repeated workload of software deployment, high labor cost and time cost consumption and low accuracy of configuration information caused by manual operation exist.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for deploying software, which can obtain a software package to be deployed, and extract configuration information from a configuration file in the software package; and automatically generating a deployment file required by the software package by using the deployment file template and combining the configuration information so as to deploy the software package through the deployment file. By automatically extracting the configuration information and generating the deployment file, the problems of high labor cost and time cost are solved, the problem of low accuracy of the configuration information caused by manual operation is solved, and the automation degree and efficiency of deployment software are improved.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for deploying software, including: acquiring a software package to be deployed, and selecting one or more configuration files in the software package; extracting configuration information of the software package from the one or more configuration files; generating a deployment file for the software package based on the configuration information and a preset deployment file template; and deploying the software package by utilizing the deployment file.
Optionally, the method for deploying software is characterized in that the selecting one or more configuration files in the software package includes: selecting a first configuration file associated with the software configuration information; and selecting a deployment configuration file related to the software deployment information to generate a second configuration file based on the deployment configuration file.
Optionally, the method of deploying software, wherein,
further comprising: acquiring a source code to be deployed; the acquiring the software package to be deployed includes: and compiling the source code by using the custom plug-in to generate a software package to be deployed.
Optionally, the method of deploying software, wherein,
the self-defined plug-in is defined with attribute information; further comprising: when the source code is compiled by using the custom plug-in, acquiring an attribute value corresponding to the attribute information from the source code through the custom plug-in, generating a first configuration file related to software configuration information based on the attribute value, and adding the first configuration file to the software package.
Optionally, the method of deploying software, wherein,
the extracting the configuration information of the software package comprises: acquiring a software identifier from the first configuration file; and determining the software configuration information contained in the configuration information based on the software identification.
Optionally, the method of deploying software, wherein,
the deployment file template comprises one or more first deployment files, wherein the first deployment files are related to the first configuration file; the generating a deployment file for the software package includes: modifying the first deployment file based on the software configuration information obtained from the first configuration file.
Optionally, the method of deploying software, wherein,
the extracting the configuration information of the software package comprises: obtaining the software type from the first configuration file; and determining the software deployment information contained in the configuration information based on the software type.
Optionally, the method of deploying software, wherein,
the deployment file template comprises one or more second deployment files, wherein the second deployment files are related to the second configuration files; the generating a deployment file for the software package includes: determining a third deployment file from the one or more second deployment files according to the software type; modifying the third deployment file using the software deployment information obtained from the second configuration file.
Optionally, the method of deploying software is characterized in that,
further comprising: updating the deployment file template based on the deployment file; or, further comprising: generating a new deployment file template based on the deployment file and the deployment file template; and selecting a deployment file template matched with the version information of the software package from the deployment file template and the new deployment file template.
Optionally, the method of deploying software, wherein,
further comprising: a deployment tool is arranged; the deploying the software package comprises: and in the case of receiving a deployment instruction for the software package, processing the deployment instruction by using the deployment tool, and deploying the software package based on the processed result and the deployment file.
Optionally, the method for deploying software, where the processing the deployment instruction by using the deployment tool, and deploying the software package based on the processed result and the deployment file includes: analyzing parameter values contained in the deployment instruction by using the deployment tool; when the parameter value is inconsistent with the value of the configuration information included in the deployment file: and updating the value of the configuration information included in the deployment file according to the parameter value, and deploying the software package based on the updated deployment file.
To achieve the above object, according to a second aspect of an embodiment of the present invention, there is provided an apparatus for deploying software, including: the method comprises the steps of obtaining a configuration file module, generating a deployment file module and a deployment software module; wherein the content of the first and second substances,
the configuration file acquisition module is used for acquiring a software package to be deployed and selecting one or more configuration files in the software package;
the deployment file generation module is used for extracting the configuration information of the software package from the one or more configuration files; generating a deployment file for the software package based on the configuration information and a preset deployment file template;
the deployment software module is used for deploying the software package by using the deployment file.
To achieve the above object, according to a third aspect of the embodiments of the present invention, there is provided an electronic device for deploying software, including: one or more processors; a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the methods of deploying software described above.
To achieve the above object, according to a fourth aspect of the embodiments of the present invention, there is provided a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method as in any one of the methods of deploying software described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps that a software package to be deployed can be obtained, and configuration information is extracted from a configuration file in the software package; and automatically generating a deployment file required by the software package by using the deployment file template and combining the configuration information so as to deploy the software package through the deployment file. By automatically extracting the configuration information and generating the deployment file, the problems of high labor cost and time cost are solved, the problem of low accuracy of the configuration information caused by manual operation is solved, and the automation degree and efficiency of deployment software are improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flow chart illustrating a method for deploying software according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a deployment software according to an embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for deploying software according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The present invention takes a hellm tool as an example to describe a method for automatically deploying software based on the hellm tool, wherein the hellm is a package manager of Kubernetes, and a configuration file and a deployment file in the following examples take a file of the hellm tool as an example.
As shown in fig. 1, an embodiment of the present invention provides a method for deploying software, which may include the following steps:
step S101: the method comprises the steps of obtaining a software package to be deployed, and selecting one or more configuration files in the software package.
Specifically, the software deployment generally includes processes of packaging, installing, configuring and releasing software, and the software package to be deployed may be one or more compressed files, such as: zip or test, jar, the specific content and format of the software package to be deployed are not limited, and the software packages mentioned in the invention are all indicated as the software packages to be deployed, i.e. the software packages are the software packages to be deployed.
Further, one or more configuration files are selected in the software package. I.e., obtaining deployment-related configuration files from the software package to extract configuration information from the configuration files.
Further, the selecting one or more configuration files in the software package includes: selecting a first configuration file associated with the software configuration information; and selecting a deployment configuration file related to the software deployment information to generate a second configuration file based on the deployment configuration file.
The software configuration information includes basic software information corresponding to the software package to be deployed, for example, a software identifier: appName, software type: such as web applications or non-web applications, etc.; the first configuration file related to the software configuration information may be obtained from a specific directory of the software, for example, the first configuration file is: yaml, illustratively, the contents of the first configuration file include software configuration information (software identification, software type, etc.), such as: appConfig.yaml comprises: properties: appName: test-service; namespace: test; type: the web, etc. The software deployment information is information required for deployment, and for example, includes addresses, ports, parameters and the like of deployed target clusters; the deployment configuration file associated with the software deployment information is one or more of, for example: obtaining a plurality of deployment configuration files from a directory test-main \ conf \ of the software package, wherein the deployment configuration files comprise: applications, properties, jdbc properties, log4j2.xml and the like, it can be understood that the conf directory includes a plurality of configuration files, the deployment configuration files are obtained by selecting from the plurality of configuration files, and then the configuration information required by the deployment software is extracted through the selected deployment configuration files; generating a second configuration file based on the selected deployment configuration file related to the software deployment information, wherein the second configuration file is, for example, project config.yaml, and the fragments of the second configuration file are as follows:
wherein the content in the second configuration file is extracted from each configuration file related to the software deployment information, i.e. to generate the second configuration file based on the deployment configuration file; the deployment configuration file may also include a configuration file, and the second configuration file may include software information (e.g., a software identifier appName) acquired from the first configuration file.
Step S102: extracting configuration information for the software package from the one or more configuration files.
Specifically, the configuration files include the first configuration file and the second configuration file described in step S101, the configuration information of the software package is extracted from the one or more configuration files, the configuration information includes software configuration information corresponding to the first configuration file and software deployment information corresponding to the second configuration file, and the specific descriptions of the software configuration information and the software deployment information are consistent with the description in step S101, and are not repeated here.
Further, the extracting the configuration information of the software package includes: acquiring the software identification from the first configuration file; and determining the software configuration information contained in the configuration information based on the software identification. Wherein, the first configuration file is appconfig.yaml, and the software identifier is obtained from appconfig.yaml, for example: appName (software identifier) is test-service; and further acquiring software configuration information related to the software, such as namespace and the like, based on the software identification.
The extracting the configuration information of the software package comprises: obtaining the software type from the first configuration file; and determining software deployment information contained in the configuration information based on the software type, and generating a second configuration file based on the software deployment information. Wherein, the first configuration file is appconfig.yaml, and the software type is obtained from appconfig.yaml, such as: if the software type is web application, extracting corresponding software deployment information for the web application, wherein the specific description of the software deployment information is consistent with that of the step S101, and is not described herein again; it will be appreciated that the same portion may exist for configuration information of different software types.
Further, generating a second configuration file project config.yaml based on the software deployment information, where the second configuration file and the example project config.yaml are consistent with the description of step S101 and are not described herein again.
The configuration files required by deployment are automatically selected from the software package, and the configuration information related to the deployment is correspondingly extracted from the configuration files, so that the automation of acquiring the configuration information is realized, and the problems of high labor cost and high time cost caused by manually acquiring the configuration information are solved.
Step S103: and generating a deployment file for the software package based on the configuration information and a preset deployment file template.
Specifically, the preset deployment file template includes a plurality of deployment files for deployment, and the deployment file template is modified based on the deployment file template and the configuration information to generate a deployment file required for deploying the software.
For example, the preset deployment file template includes the following files:
further, the deployment file template contains one or more first deployment files, wherein the first deployment files are related to the first configuration file; the generating a deployment file for the software package includes: modifying the first deployment file based on the software configuration information. Specifically, as shown in a preset deployment file template example, chart.yaml is a first deployment file, appcontrol.yaml is a first configuration file, chart.yaml is associated with appcontrol.yaml, that is, the first deployment file is related to the first configuration file, and based on appName (test-service) and other information contained in appcontrol.yaml, information such as name, version, description and the like corresponding to chart.yaml is modified as follows, wherein the version can be automatically generated according to a predetermined rule based on date, software identifier, version and the like, and the description can be automatically generated by using the appName or name space and other information:
name:test-service
namespace:test
version:v20200202_test_11111
description:test-service-template
that is, Chart.yaml is modified based on software configuration information such that Chart.yaml is one of the deployment files required to deploy the software, i.e., the first deployment file is modified based on the software configuration information obtained from the first configuration file. It is understood that chart. yaml may contain fixed content that does not need to be modified, such as: apiVersion: v1, appVersion:1.16.0, and the like. The invention does not limit the specific quantity, the specific content and the format of the first deployment file.
Further, the deployment file template contains one or more second deployment files, wherein the second deployment files are related to the second configuration files; the generating a deployment file for the software package includes: determining a third deployment file from the one or more second deployment files according to the software type; modifying the third deployment file using the software deployment information obtained from the second configuration file. Specifically, for example, the plurality of second deployment files are: nos. txt, 123.tpl, deployment.yaml, ingress.yaml, service.yaml, value.yaml, etc.; it can be understood that, in order to deploy software, when part of the second deployment files in the plurality of second deployment files needs to be modified, the second deployment files needing to be modified are automatically selected as third deployment files; further, for software types, a different third deployment file may be employed, such as: for a web application software type, the determined third deployment file is a deployment file, ingress, yaml, service, yaml, value, yaml, and for a java application (non-web application) software type, the determined third deployment file is a deployment file, value, yaml, and the like, that is, according to the software type, a third deployment file is determined from the one or more second deployment files, for example: third deployment files for the web application software type determined from the second deployment files nos. txt, 123.tpl, deployment. yaml, ingress.yaml, service.yaml, value.yaml are deployment files. Further, taking values.yaml as a third deployment file and project config.yaml as a second configuration file as an example, modifying the third deployment file by using the software deployment information is described, for example: add (i.e., modify) to values.yaml the following software deployment information contained by project config.yaml, i.e., modify values.yaml to generate one of the deployment files required to deploy the software:
where values.yaml may contain content that does not need to be modified, such as: container information (containers-name), mirror image information contained in the container (image: replay: 111pullpolicy: IfNotPresent, etc.), container parameters (resources, readainssProbe, livenessProbe), and corresponding parameter values, etc.; further, the deployment element yaml is correspondingly modified according to the data (derived from the second configuration file project config. yaml) of the configfileMounts part contained in the value.
Therefore, the first deployment file in the deployment file template is modified by the software configuration information obtained from the first configuration file, the third deployment file in the deployment file template is modified by the software deployment information obtained from the second configuration file, so that the modified deployment file template is the deployment configuration file of the automatically generated deployment software, the efficiency of generating the deployment file is improved, the problems of high labor cost and high time cost of manually configuring the deployment file are solved, and the problem of reduction of the accuracy of configuring the deployment file due to manual operation is solved. Wherein, generating the deployment file can be completed by adopting a plug-in technology.
Further, there are two methods for updating the deployment file template based on the first deployment file or the third deployment file:
the first method comprises the following steps: updating the deployment file template based on the deployment file; specifically, after each deployment file needing to be modified is updated, an updated deployment file template is formed, for example, the updated deployment file template is identified as test-111-template, the updated deployment file is saved, and when the deployment file is updated, iterative modification can be performed based on the test-111-template to generate the test-112-template, so that the configuration information needing to be modified is reduced, and the efficiency of generating the deployment file is further improved.
The second method comprises the following steps: generating a new deployment file template based on the deployment file and the deployment file template; and selecting a deployment file template matched with the version information of the software package from the deployment file template and the new deployment file template. Specifically, each updated deployment file template is saved, that is, the deployment file template used for deploying the software each time is saved, so that a matched deployment file template is selected according to the version information, and is modified based on the selected deployment file template to generate a new deployment file template for deploying the software of the version.
Step S104: and deploying the software package by utilizing the deployment file.
Specifically, when the software package is deployed by using the deployment file, a customized deployment instruction of the deployment software can be provided through a customized deployment tool, wherein the customized deployment instruction can be composed of a Linux customized command or a CLI client and a CLI service program in other programming languages. That is, a deployment tool is provided; the deploying the software package comprises: in case a deployment instruction for the software package is received, processing the deployment instruction with the deployment tool and deploying the software package based on the processed result and the deployment file, for example: the self-defined deployment instruction of the self-defined deployment tool for deploying the software comprises the following steps:
smartInstall test test.tar.gz-n namespace-d'{
"namespace":"test",
"ingressHost":"test.com.cn"
wherein smartInstall is a custom tool, and test.
After receiving the customized deployment instruction, processing the deployment instruction, for example: acquiring container information according to the deployment instruction, for example: the mirror image warehouse address is obtained, and the obtaining method can be as follows: cat/etc/docker/daemon.json; further, the parameter values included in the deployment instruction are analyzed, for example: if the parameter value corresponding to the parameter namespace contained in the deployment instruction is "test", judging whether the parameter value is consistent with the corresponding attribute and attribute value (namespace: test) contained in the deployment file value.yaml, if not, modifying the attribute value of the corresponding configuration information in the value.yaml according to the input parameter value, namely, utilizing the deployment tool to analyze the parameter value contained in the deployment instruction; when the parameter value is inconsistent with the value of the configuration information included in the deployment file: and updating the value of the configuration information included in the deployment file according to the parameter value. By dynamically modifying the deployment file according to the input parameters and the parameter values in the deployment stage, the flexibility of software deployment is improved, and the efficiency of software deployment is further improved.
Further, after the customized deployment instruction is processed, a deployment instruction of the tool helm is called to perform an operation of software deployment, for example, the software deployment is performed through the following instructions:
helm install test test-v20201211_183925.tar.gz-n test
test-v20201211_183925.tar.gz is a software package to be deployed, and the identifier of the software package can be automatically generated through configuration information, that is, the software package is deployed based on the updated deployment file.
As shown in fig. 2, an embodiment of the present invention provides a method for deploying software, which may include the following steps:
step S201: the method includes selecting a first configuration file in the software package related to software configuration information and selecting a deployment configuration file related to software deployment information to generate a second configuration file based on the deployment configuration file.
Specifically, the first configuration file appconfig.yaml may be generated when the source code is compiled to generate a software package, wherein a tool for compiling the source code may adopt a custom plug-in to obtain software configuration information in the source code while the source code is compiled to the software package, so as to generate the first configuration file appconfig.yaml through each piece of software configuration information; namely, acquiring a source code to be deployed; the acquiring the software package to be deployed includes: and compiling the source code by using the custom plug-in to generate a software package to be deployed. The custom plug-in is, for example: smart build-plugin, which can be constructed by using a plugin technology of a maven tool to extend the functions of the existing compiling plugin so as to obtain software configuration information (namely attribute information); namely, the self-defined plug-in is defined with attribute information; further comprising: when the source code is compiled by using the custom plug-in, acquiring an attribute value corresponding to the attribute information from the source code through the custom plug-in, generating a first configuration file related to software configuration information based on the attribute value, and adding the first configuration file to the software package. The attribute information and the attribute value corresponding to the attribute information are, for example: appName (attribute information), test-service (corresponding attribute value).
Further, the software configuration information includes a software identifier and a software type, wherein the software identifier may be obtained from a file included in a set directory, for example, the set directory is iprject > src > main > java, an obtaining method of the software type may be determined by determining whether "java" is defined, servlet. Further, based on the selected configuration file related to the software configuration information, a first configuration file is generated, wherein the first configuration file is, for example: yaml, content includes software configuration information, such as: properties: appName: test-service; namespace: test; type: web, etc.
Preferably, the source code is compiled by the user-defined plug-in to generate the software package, and the corresponding software package can be generated according to different target environments (such as a test environment, a development environment, a production environment and the like), so that the efficiency and the expansibility for generating the software package are improved. Further, the present invention extracts corresponding configuration information for each software package for different target environments, where the configuration information corresponding to different target environments is usually different, and the configuration information includes: the invention solves the problems of high time cost caused by the fact that information needs to be extracted manually in the prior art, and solves the problem that the information error rate is increased caused by manual operation.
Further, acquiring a software package to be deployed, selecting a first configuration file related to the software configuration information from the software package, and selecting a deployment configuration file related to the software deployment information, so that a description of generating a second configuration file based on the deployment configuration file is consistent with the description of step S101, which is not repeated herein
Step S202: acquiring a software identifier from the first configuration file; and determining the software configuration information contained in the configuration information based on the software identification.
Specifically, the description about determining that the software configuration information included in the configuration information is consistent with the description of step S101 to step S102, and is not repeated herein.
Step S203: the deployment file template comprises one or more first deployment files, wherein the first deployment files are related to the first configuration file; the generating a deployment file for the software package includes: modifying the first deployment file based on the software configuration information obtained from the first configuration file.
Specifically, the specific description about the first deployment file and the modification of the first deployment file based on the software configuration information is consistent with the description in step S103, and is not repeated here.
Step S204: obtaining a software type from the first configuration file; and determining software deployment information contained in the configuration information based on the software type, and generating a second configuration file based on the software deployment information.
Specifically, the descriptions of determining the software deployment information and the second configuration file included in the configuration information are consistent with the descriptions of step S101 to step S102, and are not repeated here.
Step S205: the deployment file template comprises one or more second deployment files, wherein the second deployment files are related to the second configuration files; generating a deployment file for the software package, comprising: determining a third deployment file from the one or more second deployment files according to the software type; modifying the third deployment file using the software deployment information obtained from the second configuration file.
Specifically, the specific description about the second deployment file, the third deployment file, and the modification of the third deployment file by using the software deployment information is consistent with the description in step S103, and is not repeated here.
Step S205: and deploying the software package by utilizing the deployment file.
Specifically, with the deployment file generated by the present invention, the specific description of the deployment software package is consistent with the description of step S104, which is not described herein again.
As shown in fig. 3, an embodiment of the present invention provides an apparatus 300 for deploying software, including: the method comprises the following steps: a configuration file obtaining module 301, a deployment file generating module 302 and a deployment software module 303; wherein the content of the first and second substances,
the configuration file acquiring module 301 is configured to acquire a software package to be deployed, and select one or more configuration files in the software package;
the generate deployment file module 302 is configured to extract configuration information of the software package from the one or more configuration files; generating a deployment file for the software package based on the configuration information and a preset deployment file template;
the deployment software module 303 is configured to deploy the software package by using the deployment file.
An embodiment of the present invention further provides an electronic device for deploying software, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method provided by any one of the above embodiments.
Embodiments of the present invention further provide a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method provided in any of the above embodiments.
Fig. 4 illustrates an exemplary system architecture 400 to which the method of deploying software or the apparatus for deploying software of an embodiment of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. Various client applications may be installed on the terminal devices 401, 402, 403.
The terminal devices 401, 402, 403 may be various electronic devices having display screens and supporting various client applications, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server providing support for client applications used by users with the terminal devices 401, 402, 403. The background management server can process the received request for deploying the software and feed back the result of deploying the software to the terminal equipment.
It should be noted that the method for deploying software provided by the embodiment of the present invention is generally performed by the server 405, and accordingly, the apparatus for deploying software is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units described in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware. The described modules and/or units may also be provided in a processor, and may be described as: a processor includes an acquire configuration file module, a generate deployment file module, and a deploy software module. The names of these modules do not in some cases form a limitation on the modules themselves, for example, a deployment software module may also be described as a "module that deploys the software package using the deployment file".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a software package to be deployed, and selecting one or more configuration files in the software package; extracting configuration information of the software package from the one or more configuration files; generating a deployment file for the software package based on the configuration information and a preset deployment file template; and deploying the software package by utilizing the deployment file.
According to the embodiment of the invention, the software package to be deployed can be obtained, and the configuration information is extracted from the configuration file in the software package; and automatically generating a deployment file required by the software package by using the deployment file template and combining the configuration information so as to deploy the software package through the deployment file. By automatically extracting the configuration information and generating the deployment file, the problems of high labor cost and time cost are solved, the problem of low accuracy of the configuration information caused by manual operation is solved, and the automation degree and efficiency of deployment software are improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:程序升级应用电路与程序升级应用装置