CN114610340A - Project deployment method, device, equipment and storage medium - Google Patents

Project deployment method, device, equipment and storage medium Download PDF

Info

Publication number
CN114610340A
CN114610340A CN202210283478.4A CN202210283478A CN114610340A CN 114610340 A CN114610340 A CN 114610340A CN 202210283478 A CN202210283478 A CN 202210283478A CN 114610340 A CN114610340 A CN 114610340A
Authority
CN
China
Prior art keywords
deployment
project
target
deployed
code
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.)
Pending
Application number
CN202210283478.4A
Other languages
Chinese (zh)
Inventor
李海斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202210283478.4A priority Critical patent/CN114610340A/en
Publication of CN114610340A publication Critical patent/CN114610340A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention relates to the field of cloud deployment, and discloses a method for deploying a project, which comprises the following steps: acquiring a project to be deployed, analyzing the project to be deployed to obtain deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file; when code updating occurs in the project to be deployed, reading an updating source code in the project to be deployed; extracting a code index in the updating source code, and inquiring deployment environment parameters in the target configuration file according to the code index to obtain target deployment environment parameters of the updating source code; and deploying the updated source code into the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed. The invention also provides a project deployment device, equipment and a storage medium. The invention can improve the accuracy of project deployment.

Description

Project deployment method, device, equipment and storage medium
Technical Field
The invention relates to the field of cloud deployment, in particular to a method and a device for deploying a project, electronic equipment and a readable storage medium.
Background
Project deployment refers to a process of running source code of a project in a specified environment after the project development is finished, for example, after a software development process needing updating is finished, the software is put into an environment to be deployed, and the software can work normally on a target environment through some configurations.
At present, common project deployment is generally performed manually, when target environments are too many, source codes of projects are easily deployed into wrong environments by manually performing target deployment, so that errors occur in project deployment, and the accuracy of project deployment is reduced.
Disclosure of Invention
The invention provides a project deployment method, a project deployment device, electronic equipment and a computer readable storage medium, and aims to improve the accuracy of project deployment.
In order to achieve the above object, the present invention provides a method for item deployment, including:
acquiring a project to be deployed, analyzing the project to be deployed to obtain deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
when code updating occurs in the project to be deployed, reading an updating source code in the project to be deployed;
extracting a code index in the updating source code, and inquiring deployment environment parameters in the target configuration file according to the code index to obtain target deployment environment parameters of the updating source code;
and deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
Optionally, the querying, according to the code index, the deployment environment parameter in the target configuration file to obtain the target deployment environment parameter of the updated source code includes:
acquiring an index target type and an index method of the code index;
determining a query target of the code index according to the index target type;
and matching the target configuration files according to the index method, and taking the successfully matched deployment environment parameters as the target deployment environment parameters of the updated source codes.
Optionally, the matching the target configuration file according to the indexing method includes:
analyzing the index method to obtain a corresponding hash function;
carrying out hash operation on the code index to obtain a corresponding hash value;
and searching the deployment environment parameter corresponding to the hash value in the target configuration file to obtain a target deployment environment parameter.
Optionally, the deploying the updated source code to the operating environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed, including:
analyzing the deployment script file to obtain a project deployment instruction;
querying a local running environment matched with the target deployment environment parameters;
and releasing the updated source code into the operating environment according to the project deployment instruction, and compiling the updated source code to obtain a deployment result of the project to be deployed.
Optionally, the querying a local operating environment matching the target deployment environment parameter includes:
receiving the target deployment environment parameters by using a preset parameter interface;
extracting environmental method parameters and environmental component parameters in the target deployment environmental parameters;
according to the environment component parameters, a programming module of the target deployment environment parameters is constructed, and a function corresponding to the environment method parameters under the programming module is obtained;
generating target data corresponding to the target deployment environment parameters by using the function to obtain operation environment parameters;
and traversing the parameter setting of the local operating environment, and judging that the operating environment is successfully matched with the target deployment environment parameter when the parameter setting is the same as the operating environment parameter.
Optionally, the analyzing the project to be deployed to obtain the deployment environment parameter corresponding to the project to be deployed includes:
acquiring a source code in the project to be deployed;
and capturing deployment environment parameters corresponding to the target key fields in the source code according to preset target key fields to obtain the deployment environment parameters.
Optionally, when a code update occurs in the project to be deployed, reading an update source code in the project to be deployed, where the reading includes:
constructing a code warehouse, and when a code is updated in the project to be deployed, using a preset script file to pull the updated code to the code warehouse for storage;
monitoring the code warehouse, and when the code in the code warehouse is updated or increased, pulling the changed source code in the code warehouse by using a preset hook to obtain an updated source code.
In order to solve the above problem, the present invention further provides a project deployment apparatus, including:
the target configuration file construction module is used for acquiring a project to be deployed, analyzing the project to be deployed, obtaining deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
the target parameter matching module is used for reading an updating source code in the project to be deployed when a code updating occurs in the project to be deployed, extracting a code index in the updating source code, and inquiring the deployment environment parameter in the target configuration file according to the code index to obtain a target deployment environment parameter of the updating source code;
and the project deployment module is used for deploying the updated source code into the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
a processor that executes a computer program stored in the memory to implement the item deployment method described above.
In order to solve the above problem, the present invention also provides a computer-readable storage medium in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the above-mentioned item deploying method.
The project deployment method provided by the embodiment of the invention firstly obtains the project to be deployed, analyzes the project to be deployed to obtain the deployment environment parameters corresponding to the project to be deployed, and stores the deployment environment parameters into the preset configuration file to obtain the target configuration file, so that each project has the corresponding deployment environment parameters when the project is deployed, and the success rate of the project deployment is improved; secondly, when the codes in the project to be deployed are updated, reading the update source codes in the project to be deployed, ensuring that the project can be deployed quickly and improving the efficiency of the project deployment; furthermore, the code index in the update source code is extracted, the deployment environment parameter in the target configuration file is inquired according to the code index, and the target deployment environment parameter of the update source code is obtained, so that the update source code is matched with the corresponding target deployment environment parameter, the update source code can be ensured to run in a target environment, and the project deployment accuracy is improved. Therefore, the project deployment method, the project deployment device, the electronic equipment and the computer-readable storage medium can improve the accuracy of project deployment.
Drawings
Fig. 1 is a schematic flow chart of a project deployment method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a project deployment apparatus according to an embodiment of the present invention;
fig. 3 is a schematic internal structural diagram of an electronic device for implementing a method for item deployment according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a project deployment method. The execution subject of the item deployment method includes, but is not limited to, at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiments of the present application. In other words, the item deployment method may be executed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end can comprise an independent server, and can also comprise a cloud server which provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), big data and artificial intelligence platform and the like.
Referring to a flow diagram of a method for item deployment according to an embodiment of the present invention shown in fig. 1, in an embodiment of the present invention, the method for item deployment includes:
s1, acquiring the project to be deployed, analyzing the project to be deployed to obtain the deployment environment parameters corresponding to the project to be deployed, and saving the deployment environment parameters into a preset configuration file to obtain a target configuration file.
In the embodiment of the present invention, the project to be deployed refers to a project corresponding to a code available for a target environment, which is created after a development server is locally built for project development and coding is completed, where the project may be a new project or a project to be updated, and the present invention is not limited thereto. For example, after development is completed, and code that can be used in the target environment is generated, the software is the project to be deployed. The deployment environment parameters refer to different environment data structure parameters corresponding to different projects to be deployed or function names for generating the corresponding different environment data structure parameters.
In the embodiment of the invention, the configuration file refers to a file for storing project operation parameters.
In the optional embodiment of the invention, the project to be deployed is obtained by pulling the project which is developed in the development server and generates the corresponding code, and the target of project deployment is determined so as to more accurately deploy the project.
As an optional embodiment of the present invention, the analyzing the to-be-deployed item to obtain a deployment environment parameter corresponding to the to-be-deployed item includes:
acquiring a source code in the project to be deployed;
and capturing deployment environment parameters corresponding to the target key fields in the source code according to preset target key fields to obtain the deployment environment parameters.
Furthermore, the embodiment of the present invention obtains the deployment environment parameters corresponding to the to-be-deployed project by analyzing the to-be-deployed project, and determines the target environment of the to-be-deployed project, so as to ensure that the corresponding target environment can be correctly matched during subsequent project deployment, thereby implementing project operation.
S2, when the code update occurs in the project to be deployed, reading the update source code in the project to be deployed.
In the embodiment of the present invention, the source code update refers to a source code of the project to be deployed after the project development or a source code of the project to be deployed after the project update.
According to the embodiment of the invention, when the code in the project to be deployed is updated, the updating source code in the project to be deployed is read, so that the updating source code is pulled, the accuracy of the updating source code is ensured, and the accuracy of project deployment is ensured.
As an embodiment of the present invention, when a code update occurs in a project to be deployed, reading an update source code in the project to be deployed, includes:
constructing a code warehouse, and when a code is updated in the project to be deployed, using a preset script file to pull the updated code to the code warehouse for storage;
monitoring the code warehouse, and when the code in the code warehouse is updated or increased, pulling the changed source code in the code warehouse by using a preset hook to obtain an updated source code.
In the embodiment of the present invention, the code repository refers to a database for storing codes. The hooks may be webhooks that are used to listen to the code repository and pull updated source code.
In the optional embodiment of the invention, the updated code is pulled to the code warehouse for storage by writing the script file for automatically pulling the updated code, so that the risk caused by errors such as disappearance of local codes due to program errors is reduced.
In another optional embodiment of the invention, whether the code warehouse has code update or not is judged by monitoring the code warehouse, and when the code warehouse has code update, the update source code in the code warehouse is acquired through webhooks, so that the accuracy of the update source code is ensured, and the accuracy of project deployment is improved.
S3, extracting the code index in the updated source code, and inquiring the deployment environment parameter in the target configuration file according to the code index to obtain the target deployment environment parameter of the updated source code.
In the embodiment of the present invention, the code index refers to a position index of the deployment environment parameter, and is generally used to find a position of the deployment environment parameter corresponding to the update source code in the target configuration file.
In the optional embodiment of the invention, the code index is established by determining the target type and the index method of the index, so that the code index in the updated source code is extracted, the target deployment environment parameter corresponding to the updated source code is successfully inquired, and the project deployment accuracy is improved.
Furthermore, according to the code index, the deployment environment parameter in the target configuration file is queried to obtain the target deployment environment parameter of the updated source code, so that the environment where the updated source code needs to be deployed is ensured, the situation that the updated source code is deployed in a non-target environment, the project deployment failure is avoided, and the success rate of project deployment is improved.
As an embodiment of the present invention, the querying, according to the code index, the deployment environment parameter in the target configuration file to obtain the target deployment environment parameter of the updated source code includes:
acquiring an index target type and an index method of the code index;
determining a query target of the code index according to the index target type;
and matching the target configuration files according to the index method, and taking the successfully matched deployment environment parameters as the target deployment environment parameters of the updated source codes.
In the embodiment of the present invention, the index target type includes Normal, uniform Full text, and the like. The indexing method comprises a B-tree, a hash function and the like.
Further, in this embodiment of the present invention, the matching the target configuration file according to the indexing method includes:
analyzing the index method to obtain a corresponding hash function;
carrying out hash operation on the code index to obtain a corresponding hash value;
and searching the deployment environment parameter corresponding to the hash value in the target configuration file to obtain a target deployment environment parameter.
In an optional embodiment of the present invention, a query target of the code index is determined according to the index target type, the target configuration files are matched according to the index method, and the deployment environment parameters successfully matched are used as the target deployment environment parameters of the update source code.
And S4, deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
In the embodiment of the invention, the deployment script file refers to a project deployment execution file written according to a certain format, and some simple but more complicated actions can be executed through the script file.
According to the method and the device, the updating source code is deployed to the running environment corresponding to the target deployment environment parameter by using the preset deployment script file, and the deployment result of the project to be deployed is obtained, so that the target environment where the updating source code is deployed is ensured to be correct, and code errors caused by target environment errors are avoided.
As an embodiment of the present invention, the deploying, by using a preset deployment script file, the updated source code to the operating environment corresponding to the target deployment environment parameter to obtain a deployment result of the to-be-deployed project includes:
analyzing the deployment script file to obtain a project deployment instruction;
querying a local operating environment matched with the target deployment environment parameters;
and releasing the updated source code into the operating environment according to the project deployment instruction, and compiling the updated source code to obtain a deployment result of the project to be deployed.
In the embodiment of the present invention, the project deployment instruction refers to an instruction for delivering the update source code to a corresponding operating environment.
Further, the querying the operating environment locally matched with the target deployment environment parameter includes:
receiving the target deployment environment parameters by using a preset parameter interface;
extracting environmental method parameters and environmental component parameters in the target deployment environmental parameters;
according to the environment component parameters, a programming module of the target deployment environment parameters is constructed, and a function corresponding to the environment method parameters under the programming module is obtained;
generating target data corresponding to the target deployment environment parameters by using the function to obtain operation environment parameters;
and traversing the parameter setting of the local operating environment, and judging that the operating environment is successfully matched with the target deployment environment parameter when the parameter setting is the same as the operating environment parameter.
In the embodiment of the invention, the environment component parameter refers to a parameter code for generating a programming module. The environment method parameter refers to a parameter code for generating a specific function.
In the optional embodiment of the invention, the running environment matched with the target deployment environment parameter is obtained by searching local environment parameters, so that the updated source code can run normally, and the accuracy of project deployment is improved.
In another optional embodiment of the present invention, according to the project deployment instruction, the update source code is released into the execution environment, and the update source code is compiled, so that the update source code can run in the execution environment, thereby obtaining a deployment result of the project to be deployed.
The project deployment method provided by the embodiment of the invention firstly obtains the project to be deployed, analyzes the project to be deployed to obtain the deployment environment parameters corresponding to the project to be deployed, and stores the deployment environment parameters into the preset configuration file to obtain the target configuration file, so that each project has the corresponding deployment environment parameters when the project is deployed, and the success rate of the project deployment is improved; secondly, when the codes in the project to be deployed are updated, reading the update source codes in the project to be deployed, ensuring that the project can be deployed quickly and improving the efficiency of the project deployment; furthermore, the code index in the update source code is extracted, the deployment environment parameter in the target configuration file is inquired according to the code index, and the target deployment environment parameter of the update source code is obtained, so that the update source code is matched with the corresponding target deployment environment parameter, the update source code can be ensured to run in a target environment, and the project deployment accuracy is improved. Therefore, the project deployment method provided by the invention can improve the accuracy of project deployment.
Fig. 2 is a functional block diagram of the project deployment apparatus according to the present invention.
The project deployment apparatus 100 of the present invention may be installed in an electronic device. According to the implemented functions, the project deployment apparatus may include a target configuration file construction module 101, a target parameter matching module 102, and a project deployment module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the target configuration file construction module 101 is configured to obtain a project to be deployed, analyze the project to be deployed, obtain deployment environment parameters corresponding to the project to be deployed, and store the deployment environment parameters in a preset configuration file to obtain a target configuration file.
In the embodiment of the present invention, the project to be deployed refers to a project corresponding to a code available for a target environment, which is created after a development server is locally built for project development and coding is completed, where the project may be a new project or a project to be updated, and the present invention is not limited thereto. For example, after development is completed, and code that can be used in the target environment is generated, the software is the project to be deployed. The deployment environment parameters refer to different environment data structure parameters corresponding to different projects to be deployed or function names for generating the corresponding different environment data structure parameters.
In the embodiment of the invention, the configuration file refers to a file for storing project operation parameters.
In the optional embodiment of the invention, the project to be deployed is obtained by pulling the project which is developed in the development server and generates the corresponding code, and the target of project deployment is determined so as to more accurately deploy the project.
As an optional embodiment of the present invention, the analyzing the project to be deployed to obtain a deployment environment parameter corresponding to the project to be deployed includes:
acquiring a source code in the project to be deployed;
and capturing deployment environment parameters corresponding to the target key fields in the source code according to preset target key fields to obtain the deployment environment parameters.
Furthermore, the embodiment of the present invention obtains the deployment environment parameters corresponding to the to-be-deployed project by analyzing the to-be-deployed project, and determines the target environment of the to-be-deployed project, so as to ensure that the corresponding target environment can be correctly matched during subsequent project deployment, thereby implementing project operation.
The target parameter matching module 102 is configured to, when a code update occurs in the to-be-deployed item, read an update source code in the to-be-deployed item, extract a code index in the update source code, and query the deployment environment parameter in the target configuration file according to the code index to obtain a target deployment environment parameter of the update source code.
In the embodiment of the present invention, the source code update refers to a source code of the project to be deployed after the project development or a source code of the project to be deployed after the project update.
According to the embodiment of the invention, when the code in the project to be deployed is updated, the updating source code in the project to be deployed is read, so that the updating source code is pulled, the accuracy of the updating source code is ensured, and the accuracy of project deployment is ensured.
As an embodiment of the present invention, when a code update occurs in a project to be deployed, reading an update source code in the project to be deployed, includes:
constructing a code warehouse, and when a code is updated in the project to be deployed, using a preset script file to pull the updated code to the code warehouse for storage;
monitoring the code warehouse, and when the code in the code warehouse is updated or increased, pulling the changed source code in the code warehouse by using a preset hook to obtain an updated source code.
In the embodiment of the present invention, the code repository refers to a database for storing codes. The hooks may be webhooks that are used to listen to the code repository and pull updated source code.
In the optional embodiment of the invention, the updated code is pulled to the code warehouse for storage by writing the script file for automatically pulling the updated code, so that the risk caused by errors such as disappearance of local codes due to program errors is reduced.
In another optional embodiment of the invention, whether the code warehouse has code updating is judged by monitoring the code warehouse, and when the code warehouse has code updating, the updating source code in the code warehouse is obtained through webhooks, so that the accuracy of the updating source code is ensured, and the accuracy of project deployment is improved.
In the embodiment of the present invention, the code index refers to a position index of the deployment environment parameter, and is generally used to find a position of the deployment environment parameter corresponding to the update source code in the target configuration file.
In the optional embodiment of the invention, the code index is established by determining the target type and the index method of the index, so that the code index in the updated source code is extracted, the target deployment environment parameter corresponding to the updated source code is successfully inquired, and the project deployment accuracy is improved.
Furthermore, according to the code index, the deployment environment parameter in the target configuration file is queried to obtain the target deployment environment parameter of the updated source code, so that the environment where the updated source code needs to be deployed is ensured, the situation that the updated source code is deployed in a non-target environment, the project deployment failure is avoided, and the success rate of project deployment is improved.
As an embodiment of the present invention, the querying, according to the code index, the deployment environment parameter in the target configuration file to obtain the target deployment environment parameter of the updated source code includes:
acquiring an index target type and an index method of the code index;
determining a query target of the code index according to the index target type;
and matching the target configuration files according to the index method, and taking the successfully matched deployment environment parameters as the target deployment environment parameters of the updated source codes.
In the embodiment of the present invention, the index target type includes Normal, uniform Full text, and the like. The indexing method comprises a B-tree, a hash function and the like.
Further, in this embodiment of the present invention, the matching the target configuration file according to the indexing method includes:
analyzing the index method to obtain a corresponding hash function;
carrying out hash operation on the code index to obtain a corresponding hash value;
and searching the deployment environment parameter corresponding to the hash value in the target configuration file to obtain a target deployment environment parameter.
In an optional embodiment of the present invention, a query target of the code index is determined according to the index target type, the target configuration files are matched according to the index method, and the deployment environment parameters successfully matched are used as the target deployment environment parameters of the update source code.
The project deployment module 103 is configured to deploy the updated source code to the operating environment corresponding to the target deployment environment parameter by using a preset deployment script file, so as to obtain a deployment result of the project to be deployed.
In the embodiment of the invention, the deployment script file refers to a project deployment execution file written according to a certain format, and some simple but more complicated actions can be executed through the script file.
According to the method and the device, the updating source code is deployed to the running environment corresponding to the target deployment environment parameter by using the preset deployment script file, and the deployment result of the project to be deployed is obtained, so that the target environment where the updating source code is deployed is ensured to be correct, and code errors caused by target environment errors are avoided.
As an embodiment of the present invention, the deploying, by using a preset deployment script file, the updated source code to the operating environment corresponding to the target deployment environment parameter to obtain a deployment result of the to-be-deployed project includes:
analyzing the deployment script file to obtain a project deployment instruction;
querying a local operating environment matched with the target deployment environment parameters;
and releasing the updated source code into the operating environment according to the project deployment instruction, and compiling the updated source code to obtain a deployment result of the project to be deployed.
In this embodiment of the present invention, the project deployment instruction refers to an instruction for launching the update source code to a corresponding operating environment.
Further, the querying the operating environment locally matched with the target deployment environment parameter includes:
receiving the target deployment environment parameters by using a preset parameter interface;
extracting environmental method parameters and environmental component parameters in the target deployment environmental parameters;
according to the environment component parameters, a programming module of the target deployment environment parameters is constructed, and a function corresponding to the environment method parameters under the programming module is obtained;
generating target data corresponding to the target deployment environment parameters by using the function to obtain operation environment parameters;
and traversing the parameter setting of the local operating environment, and judging that the operating environment is successfully matched with the target deployment environment parameter when the parameter setting is the same as the operating environment parameter.
In the embodiment of the invention, the environment component parameter refers to a parameter code for generating a programming module. The environment method parameter refers to a parameter code for generating a specific function.
In the optional embodiment of the invention, the running environment matched with the target deployment environment parameter is obtained by searching local environment parameters, so that the updated source code can run normally, and the accuracy of project deployment is improved.
In another optional embodiment of the present invention, according to the project deployment instruction, the update source code is released into the execution environment, and the update source code is compiled, so that the update source code can run in the execution environment, thereby obtaining a deployment result of the project to be deployed.
Fig. 3 is a schematic structural diagram of an electronic device for implementing the item deployment method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a project deployment program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a project deployment program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., project deployment programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication bus 12 may be a PerIPheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The project deployment program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs that, when executed in the processor 10, enable:
acquiring a project to be deployed, analyzing the project to be deployed to obtain deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
when code updating occurs in the project to be deployed, reading an updating source code in the project to be deployed;
extracting a code index in the updating source code, and inquiring deployment environment parameters in the target configuration file according to the code index to obtain target deployment environment parameters of the updating source code;
and deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
acquiring a project to be deployed, analyzing the project to be deployed to obtain deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
when code updating occurs in the project to be deployed, reading an updating source code in the project to be deployed;
extracting a code index in the updating source code, and inquiring deployment environment parameters in the target configuration file according to the code index to obtain target deployment environment parameters of the updating source code;
and deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
Further, the computer standard storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method of project deployment, the method comprising:
acquiring a project to be deployed, analyzing the project to be deployed to obtain deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
when code updating occurs in the project to be deployed, reading an updating source code in the project to be deployed;
extracting a code index in the updating source code, and inquiring deployment environment parameters in the target configuration file according to the code index to obtain target deployment environment parameters of the updating source code;
and deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
2. The method for deploying items according to claim 1, wherein the querying the deployment environment parameters in the target configuration file according to the code index to obtain the target deployment environment parameters of the update source code comprises:
acquiring an index target type and an index method of the code index;
determining a query target of the code index according to the index target type;
and matching the target configuration files according to the index method, and taking the successfully matched deployment environment parameters as the target deployment environment parameters of the updated source codes.
3. The method of item deployment according to claim 2, wherein said matching said target profile according to said indexing method comprises:
analyzing the index method to obtain a corresponding hash function;
carrying out hash operation on the code index to obtain a corresponding hash value;
and searching the deployment environment parameter corresponding to the hash value in the target configuration file to obtain a target deployment environment parameter.
4. The method for deploying the project according to claim 1, wherein deploying the update source code to the runtime environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed comprises:
analyzing the deployment script file to obtain a project deployment instruction;
querying a local operating environment matched with the target deployment environment parameters;
and releasing the updated source code into the operating environment according to the project deployment instruction, and compiling the updated source code to obtain a deployment result of the project to be deployed.
5. The method of claim 4, wherein said querying the runtime environment that locally matches the target deployment environment parameters comprises:
receiving the target deployment environment parameters by using a preset parameter interface;
extracting environmental method parameters and environmental component parameters in the target deployment environmental parameters;
according to the environment component parameters, a programming module of the target deployment environment parameters is constructed, and a function corresponding to the environment method parameters under the programming module is obtained;
generating target data corresponding to the target deployment environment parameters by using the function to obtain operation environment parameters;
and traversing the parameter setting of the local operating environment, and judging that the operating environment is successfully matched with the target deployment environment parameter when the parameter setting is the same as the operating environment parameter.
6. The method for deploying the project according to claim 1, wherein the analyzing the project to be deployed to obtain the deployment environment parameters corresponding to the project to be deployed comprises:
acquiring a source code in the project to be deployed;
and capturing deployment environment parameters corresponding to the target key fields in the source code according to preset target key fields to obtain the deployment environment parameters.
7. The method for item deployment as claimed in claim 1, wherein said reading the update source code in the project to be deployed when a code update occurs in the project to be deployed comprises:
constructing a code warehouse, and when a code is updated in the project to be deployed, using a preset script file to pull the updated code to the code warehouse for storage;
monitoring the code warehouse, and when the code in the code warehouse is updated or increased, pulling the changed source code in the code warehouse by using a preset hook to obtain an updated source code.
8. A project deployment apparatus, comprising:
the target configuration file construction module is used for acquiring a project to be deployed, analyzing the project to be deployed, obtaining deployment environment parameters corresponding to the project to be deployed, and storing the deployment environment parameters into a preset configuration file to obtain a target configuration file;
the target parameter matching module is used for reading an updating source code in the project to be deployed when a code updating occurs in the project to be deployed, extracting a code index in the updating source code, and inquiring the deployment environment parameter in the target configuration file according to the code index to obtain a target deployment environment parameter of the updating source code;
and the project deployment module is used for deploying the updated source code to the running environment corresponding to the target deployment environment parameter by using a preset deployment script file to obtain a deployment result of the project to be deployed.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the method of item deployment as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the method of item deployment as claimed in any one of claims 1 to 7.
CN202210283478.4A 2022-03-22 2022-03-22 Project deployment method, device, equipment and storage medium Pending CN114610340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210283478.4A CN114610340A (en) 2022-03-22 2022-03-22 Project deployment method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210283478.4A CN114610340A (en) 2022-03-22 2022-03-22 Project deployment method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114610340A true CN114610340A (en) 2022-06-10

Family

ID=81864178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210283478.4A Pending CN114610340A (en) 2022-03-22 2022-03-22 Project deployment method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114610340A (en)

Similar Documents

Publication Publication Date Title
CN111625252A (en) Cluster upgrading maintenance method and device, electronic equipment and storage medium
CN113961584A (en) Method and device for analyzing field blood relationship, electronic equipment and storage medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN113342472A (en) Micro-service cluster creating method and device, electronic equipment and readable storage medium
CN115048111B (en) Code generation method, device, equipment and medium based on metadata
CN111538768A (en) Data query method and device based on N-element model, electronic equipment and medium
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN115220740A (en) Database environment deployment method and device, electronic equipment and storage medium
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN114398282A (en) Test script generation method, device, equipment and storage medium
CN114356379A (en) Backup-based service upgrading method, device, equipment and storage medium
CN114610340A (en) Project deployment method, device, equipment and storage medium
CN113051171A (en) Interface test method, device, equipment and storage medium
CN112527443A (en) Prompt box display method and device, electronic equipment and computer readable storage medium
CN112685384A (en) Data migration method and device, electronic equipment and storage medium
CN112380820A (en) Automatic data backfilling method and device, electronic equipment and computer storage medium
CN113434321B (en) Method, device and equipment for processing deployment errors in operation and maintenance and storage medium
CN113342379B (en) Micro-service upgrading method and device, electronic equipment and storage medium
CN114860314B (en) Deployment upgrading method, device, equipment and medium based on database compatibility
CN113064797B (en) Front-end monitoring method and device, electronic equipment and storage medium
CN114185748A (en) System monitoring method and device, electronic 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