A deployment method, system, and storage medium
By generating deployment service packages for the front-end and server, creating deployment tasks and converting them into YAML files for service deployment, the problems of chaotic management and low efficiency in existing technologies are solved, the standardization and automation of the deployment environment are achieved, and deployment efficiency is improved.
Patent Information
- Application Number
- CN202210459316.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-04-27
AI Technical Summary
The existing service deployment method lacks a unified template or model, resulting in chaotic and inefficient management and consuming a lot of manpower and material resources.
Generate deployment service packages corresponding to the front-end and server respectively, create deployment tasks, and convert them into YAML files for service deployment to achieve deployment environment standardization and process automation.
By unifying the deployment service packages and parameters, the deployment environment is standardized and the process is automated, which greatly simplifies the deployment work and improves deployment efficiency.
Smart Images

Figure CN114879979B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet, in particular to a deployment method, system and storage medium. BACKGROUND
[0002] With the maturity and popularity of Internet technology, people's demand for network information is increasing year by year, therefore, programmers are also very critical for network maintenance, and the requirements for service deployment and maintenance are also increasing year by year. The existing deployment method is for single deployment task and is deployed separately.
[0003] In the process of researching and practicing the prior art, the inventor of the present application found that as the demand for service deployment and maintenance increases, a large amount of manpower and material resources are needed for various types of deployment; that is, there is no unified template or model for front-end deployment, back-end deployment, and front-end and back-end separation deployment, which is relatively chaotic to manage and has low deployment efficiency. SUMMARY
[0004] The technical problem solved by the present application is to provide a deployment method, system and storage medium, which can realize standardization of deployment environment and automation of deployment process, greatly simplify deployment work and improve deployment efficiency.
[0005] To solve the above technical problems, one technical solution adopted by the present application is to provide a deployment method, comprising:
[0006] generating a deployment service package corresponding to the front end and the back end, respectively; and
[0007] creating at least one deployment task, the deployment task being used to deploy at least one service;
[0008] selecting and inputting the deployment service package into the deployment task;
[0009] converting the deployment service package in the deployment task into a yaml file mode for service deployment.
[0010] Among them, the generation of the deployment service package corresponding to the front end and the back end respectively comprises:
[0011] building a compilation task;
[0012] generating a front-end deployment service package and a back-end deployment service package based on the compilation task; the front-end deployment service package has a zip package and an image file; the back-end deployment service package has a jar package and a war package.
[0013] The method further comprises:
[0014] configuring a public parameter;
[0015] The creating at least one deployment task comprises:
[0016] The creating at least one deployment task comprises:
[0017] The selecting and inputting the deployment service package to the deployment task comprises:
[0018] The selecting and inputting the deployment service package to the deployment task comprises:
[0019] The configuring the common parameter comprises:
[0020] A parameter configuration environment is provided.
[0021] The common parameter is configured in the parameter configuration environment.
[0022] If application parameter configuration is required, the application parameter is configured in the parameter configuration environment.
[0023] The common parameter is for deploying the same type or similar services, and the application parameter is for deploying multiple services to connect different data.
[0024] The creating at least one deployment task according to the set common parameter comprises:
[0025] At least one deployment task is created according to the set common parameter, and each deployment task corresponds to one deployment service package.
[0026] The selecting and inputting the deployment service package to the deployment task based on the common parameter setting comprises:
[0027] Based on the common parameter setting, the corresponding deployment service package is selected and inputted into one deployment task, and the deployment task deploys at least one service, that is, the deployment task corresponds to at least one deployment service package.
[0028] The inputting of the deployment service package is automatic selection or manual input, and the manually inputted deployment service package address is a downloadable deployment service package address or a runnable deployment service package address.
[0029] The converting the deployment service package in the deployment task into a yaml file mode for service deployment comprises:
[0030] When the deployment task is executed for service deployment, the deployment service package is converted into a yaml file mode for service deployment.
[0031] Or when the deployment task is executed for pipeline deployment, a yaml file mode is directly edited for service deployment.
[0032] To solve the above technical problems, another technical solution adopted by the present application is to provide a deployment system, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the foregoing deployment method when executing the computer program.
[0033] To solve the above technical problems, another technical solution adopted by the present application is to provide a computer readable storage medium, which stores a computer program, wherein the computer program is executable by a processor to implement the steps of the foregoing deployment method.
[0034] The above scheme, when deploying services, generates deployment service packages respectively corresponding to front ends and service ends; creates at least one deployment task, which is used to deploy at least one service; selects and inputs the deployment service packages to the deployment task; and converts the deployment service packages in the deployment task into a yaml file mode for service deployment, thereby realizing deployment environment standardization and deployment process automation, greatly simplifying deployment work and improving deployment efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a flowchart of an embodiment of the deployment method of the present application;
[0036] Figure 2 is a structural schematic diagram of an embodiment of the deployment system of the present application;
[0037] Figure 3 is a structural schematic diagram of an embodiment of the storage medium of the present application. DETAILED DESCRIPTION
[0038] The present application will be further described below in conjunction with the drawings and embodiments. It is particularly pointed out that the following embodiments are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following embodiments are only part of the embodiments of the present application, but not all the embodiments, and all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0039] In this document, reference to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification is not necessarily all referring to the same embodiment, nor is it necessarily referring to a particular alternative embodiment or set of embodiments. It will be explicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0040] The traditional deployment mode, whether front-end deployment, server-side deployment, front-end and back-end separation deployment, has no unified template deployment or unified model deployment, so that various deployments are relatively chaotic to manage.
[0041] The applicant found in the research that a custom compilation task is constructed to generate deployment service packages corresponding to the front end and the server respectively, a unified parameter deployment required for deployment is added, at least one deployment task is created, the deployment task is used to deploy at least one service, the deployment service packages are selected and input to the deployment task, that is, multiple services can be deployed under one deployment task, which is suitable for front-end and back-end separation services, and one service can also be deployed under one deployment task, and multiple deployment tasks are deployed together to deploy services, the deployment service packages in the deployment task are converted into a yaml file mode for service deployment, deployment environment standardization and deployment process automation are realized, deployment work is greatly simplified, and deployment efficiency is improved.
[0042] Therefore, a new deployment method is proposed, which can realize deployment environment standardization and deployment process automation by unifying deployment service packages and unified parameter deployment and converting deployment service packages into a yaml file mode for service deployment in the deployment task, and can solve the above technical problems to a great extent.
[0043] Based on this, the embodiment of the application provides a deployment method to solve the above technical problems.
[0044] Please refer to Figure 1 , Figure 1 is a flowchart of one embodiment of the deployment method of the application. It should be noted that the method of the application is not limited to the flow order shown in Figure 1 , such as Figure 1 , the method includes the following steps:
[0045] S101: Generate deployment service packages corresponding to the front end and the server respectively;
[0046] In the embodiment, the deployment service package is a collection of updates, repairs and / or enhancements of programs required for the deployment task, that is, a combination of a series of products and services provided in the deployment environment.
[0047] Front-end deployment service package is mainly used for the deployment of front-end services, such as Nginx front-end service deployment, which configures multiple front-end services through multiple server configurations or multiple location configurations; The difference between root and alias in location: the path behind location is the real path using root, and the virtual path using alias. The real path is the path in the local access address;
[0048] If you use Xiebao to install nginx, the folder is usually in the serve directory of the Xiebao root directory; The html folder of nginx contains the things that need to be deployed in the front-end, such as html files or the packaged dist folder of VueCLI project;
[0049] VueCLI front-end deployment: upload the packaged file: enter the nginx html folder, use the file upload of Xiebao, select the upload directory, select the corresponding dist folder after packaging, and upload it.
[0050] Configure nginx proxy: in the nginx folder, find the conf folder, and open nginx.conf in it to edit. In the html field, add a server field;
[0051] Test: enter its address in the browser: normally, you can access index.html in the dist folder. Note that the port needs to be checked in the cloud server firewall (security group). If you have installed Xiebao panel, you also need to check whether the HTTP port or HTTPS port is opened in the security column of Xiebao panel.
[0052] Deployment of ordinary Html files:
[0053] Similar to the above operation, upload the corresponding file in the html directory under the nginx directory, and then configure the nginx.conf in the conf folder to add the server field in the html field.
[0054] The service end deployment service package is used for the deployment of back-end services, and the service end here is also called back-end server;
[0055] For example, deploy SpringBoot project as back-end: install JDK1.8:
[0056] Log in to the centos interface and enter the command; require root permission, enter su and press enter, enter the password and press enter; then wait for the download to complete, enter java-version to check whether the installation is successful;
[0057] Then configure jdk environment, in the file column in the tower, find the etc folder, there is a profile file, double-click to open and edit, increase the required content, need to / usr / lib / jvm directory to view;
[0058] Then re-enter the centos interface, input command, java, if the configuration is successful, it indicates that the configuration is successful:
[0059] In some embodiments, the generating deployment service packages respectively corresponding to the front end and the service end comprises:
[0060] Building a compilation task; based on the compilation task, generating a front-end deployment service package and a back-end deployment service package; in this embodiment, the front-end deployment service package has a zip package, an image file, etc.; the back-end deployment service package has a jar package, a war package, etc.
[0061] The zip package is a compressed and decomposed format package, which is a collection of zip format files; zip format belongs to one of several mainstream compression formats, and its competitors include RAR format and open source 7z format. In terms of performance, RAR and 7z formats have higher compression rate than zip format, and 7-Zip gradually gets more applications in more fields because it provides free compression tools; the operating system starts to support zip format internally, so even if the user's computer does not install decompression software, it can open and make zip format compressed files, and OS X and popular Linux operating systems also provide similar support for zip format. Therefore, if files are transmitted and distributed on the network, zip format is often the most commonly used choice;
[0062] The image file is a file storage form, which is a type of redundancy, and a complete copy of the data on one disk exists on another disk, which is called mirroring. Many files can be made into an image file, and GHOST and other programs can be placed in a disk to be opened by GHOST and other software, and then restored to many files, and RAID 1 and RAID 10 use mirroring. Common image file formats include ISO, BIN, IMG, TAO, DAO, CIF, FCD.
[0063] Jar package is Java Archive File, as the name implies, its application is closely related to Java, JAR is a platform-independent file format, which is a class archive file built in ZIP format, with a file extension of.jar. Unlike ZIP files, JAR files are not only used for compression and distribution, but also used to deploy and package libraries, components and plug-in programs, and can be directly used by tools such as compilers and JVMs; jar package is that someone has written some classes, and then packs these classes. You can import these jar packages into your project and use the classes and properties in these jar packages directly; simply put, jar package is generally cited by others, and it contains some class files.
[0064] War package is a web application format proposed by Sun, which is a packaging format similar to jar. It is a compressed package of many files. Java web projects are packaged into war packages for release. This packaging method packages all files of the java web project and does not miss the directory. When publishing, place the war package directly under the webapp directory of the tomca directory, restart the service, and the project can run.
[0065] In some embodiments, the build compilation task is a custom build. For example, based on the components provided by the yaml file editor, such as the yaml file editor, a visual wizard task deployment method is formed, and a unified deployment model is formed for various deployment service packages generated by the compilation task to deploy services.
[0066] In some embodiments, the build compilation task is a custom build. For example, through the compilation server, the corresponding condition is set to build the compilation task; first, an integrated project building tool is developed to compile the corresponding test version program package through the integrated project building tool, and the code server stores the test version program package in the corresponding database after receiving the test version program package, to uniformly manage the test version program package, and sends the test version program package to the compilation server when the compilation server sends a request to the code server to obtain the test version program package; after the compilation server obtains the test version program package sent by the code server, the test version program package is further compiled to build a formal version program package. Specifically, the test version program package obtained by the compilation server can be compiled into a formal version program package by an integrated project building tool developed and integrated on the compilation server, and the compiled program package can be directly selected during subsequent deployment.
[0067] The compiling task generation service package forms a unified deployment model to deploy services, for example, the files or programs to be compiled are integrated through a compiling server, and a corresponding service package is generated based on the compiling task, and the service package is verified to determine whether it is generated based on the compiling task by the compiling server; and then the service package generated by the compiling server based on the compiling task is used to form a unified deployment model to deploy services.
[0068] S102: creating at least one deployment task, the deployment task being used to deploy at least one service;
[0069] The deployment task is a task-based deployment, and is used to deploy services in a unified deployment model. For example, in the first step, the basic information of the deployment task needs to be perfected; in the second step, a suitable deployment template is selected, and the system template or the custom template can be selected. If there is no required template, the "do not use the template and directly create" can be clicked. After the deployment template is selected, the deployment step is entered. In the third step, the template is created, such as the Tomcat deployment template. In the fourth step, the template content is set correspondingly. The task steps can be dragged and deleted according to the needs. After the task steps are added, the task step information needs to be set. The current configured task step is saved to the custom template, so as to facilitate the next use. After the deployment step is configured, the "parameter setting" page is switched to. The parameters of the template task can be set according to the needs. After all the information is set, the "save" is clicked. The newly created task is displayed in the deployment task page. The corresponding operation can be performed according to the actual needs.
[0070] The deployment method further includes configuring a common parameter.
[0071] The common parameter is configured, including: providing a parameter configuration environment; and configuring the common parameter in the parameter configuration environment. In this embodiment, the common parameter set in the parameter configuration environment can be selected when the deployment task is created. If the application parameter needs to be configured, the application parameter is configured in the parameter configuration environment. For example, the application parameter can be set in the environment of setting the common parameter. Then, multiple sets of services can be checked, and the deployment efficiency is improved.
[0072] The at least one deployment task is created based on the set common parameter.
[0073] The at least one deployment task is created based on the set common parameter. In this embodiment, the created deployment task is a task-based deployment task, and each deployment task corresponds to a deployment service package.
[0074] The deployment service package is selected and input to the deployment task based on the common parameter.
[0075] The deployment service package is selected and input to the deployment task based on the common parameter.
[0076] In some embodiments, the configuring the common parameters comprises: providing a parameter configuration environment; configuring the common parameters in the parameter configuration environment; the common parameters are for all services of the same type, i.e., the same type or similar services can be deployed under the common parameters, or the parameters are set for deploying multiple sets of the same services without repeated settings, such as registering to the same registration center and the same cache service.
[0077] In some embodiments, if application parameter configuration is required, the application parameters are configured in the parameter configuration environment; the application parameters are specific to the deployed services, such as deploying multiple services that need to connect different database instances.
[0078] In some embodiments, the common parameters and the application parameters can be directly manually inputted or imported, i.e., whether the common parameters or the application parameters, the format is fixed, which can be manually set individually or in batches, or can be pre-set and then imported individually or in batches, and are all parameters used by the deployed services, which can be customized according to the needs of the deployed services.
[0079] S103: selecting and inputting the deployment service package to the deployment task;
[0080] The selecting and inputting the deployment service package to the deployment task comprises:
[0081] Based on the common parameters configured in step S102, the deployment service package generated in step S101 is selected and inputted to the deployment task.
[0082] Further, based on the common parameter settings, the corresponding deployment service package is selected and inputted to a deployment task, and the deployment task deploys at least one service, i.e., the deployment task corresponds to at least one deployment service package;
[0083] Further, the inputting of the deployment service package is automatic selection or manual input; wherein the manually inputted deployment service package address is a downloadable deployment service package address or a runnable deployment service package address, etc., for example, the downloadable deployment service package address includes: downloadable jar package, downloadable war package, and downloadable ftp address; and the runnable deployment service package address includes: runnable service image address.
[0084] In some embodiments, multiple services can be deployed under one deployment task, which is suitable for services with front-end and back-end separation; for example, two or more services are deployed under one deployment task, so that the services with front-end and back-end separation can be deployed at the same time, thereby improving the deployment efficiency.
[0085] In some embodiments, one service is deployed under one deployment task, and multiple deployment tasks are deployed together; for example, two or more deployment tasks are set to be deployed simultaneously, and one service is deployed under each deployment task, so that multiple services of the front end or the back end are deployed simultaneously, thereby improving the deployment efficiency.
[0086] S104: converting the deployment service package in the deployment task into a yaml file for service deployment.
[0087] YAML is a highly readable language that is very close to the data structure of a program language. It is a data markup language that is easy to use, has rich expression ability and scalability; YAML is actually a recursive abbreviation of "YAML Ain't a Markup Language" (YAML is not a markup language), so it emphasizes data itself rather than focusing on markup.
[0088] In some embodiments, the deployment service package is converted into a yaml file for service deployment when the deployment task is executed for service deployment; for example, the service deployment can be converted into a visual and editable yaml file format.
[0089] In some embodiments, the yaml file is directly edited for service deployment when the deployment task is executed for pipeline deployment; for example, the yaml file is directly edited for service deployment when the pipeline deployment is directly edited.
[0090] In some embodiments, the yaml file is directly edited for service deployment when the deployment task is executed for pipeline deployment; for example, the yaml file is directly edited for service deployment when the pipeline deployment is directly edited.
[0091] For the above deployment method, the corresponding deployment service will be generated in the console, and the specific deployment details can be viewed.
[0092] It can be understood that the above deployment method adopts a task-based deployment or an arrangement file to uniformly deploy a model or a template, for example, an editor for yaml file formatting and visual k8s service arrangement is used.
[0093] It can be understood that the deployment steps of the above deployment method can be performed before, after, or synchronously with the public parameter setting, that is, the order of the deployment method of the present application is not limited.
[0094] In the embodiment, the deployment service package corresponding to the front end and the service end respectively is generated under the self-defined build compilation task, the deployment service packages are uniformly deployed, and then the deployment task is built to convert the deployment service package into a yaml file mode for service deployment, and the uniform deployment of public parameters and application parameters is performed to form a uniform model framework of front end deployment, service end deployment or front and rear end separation deployment, which can be directly reused, quickly deployed, conveniently managed and maintained, and the deployment efficiency is improved.
[0095] Please refer to Figure 2 , Figure 2 is a structural schematic diagram of an embodiment of the deployment system of the present application. The deployment system can perform the steps of deploying the service in the above method. For related content, please refer to the detailed description in the above method, which will not be repeated here.
[0096] The deployment system 200 includes a memory 220, a processor 210, and a computer program stored in the memory 220 and executable on the processor 210.
[0097] When the processor 210 executes the computer program, it can perform the steps of deploying the service in the above method. For related content, please refer to the detailed description in the above method, which will not be repeated here.
[0098] Please refer to Figure 3 , Fig. is a structural schematic diagram of an embodiment of the computer readable storage medium of the present application. The computer readable storage medium 300 stores a computer program 310, which is executed by the processor to implement the steps of deploying the service in the above method. For related content, please refer to the detailed description in the above method, which will not be repeated here.
[0099] The above scheme, when deploying the service, generates deployment service packages corresponding to the front end and the service end respectively; and creates at least one deployment task, the deployment task is used to deploy at least one service; selects and inputs the deployment service package to the deployment task; converts the deployment service package in the deployment task into a yaml file mode for service deployment, realizes deployment environment standardization and deployment process automation, greatly simplifies the deployment work, and improves the deployment efficiency.
[0100] In several embodiments provided by the present application, it should be understood that the disclosed system, apparatus and method can be implemented in other manners. For example, the apparatus embodiments described above are merely schematic. For example, the division of the modules or units is merely logical function division. There can be another division manner for the actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0101] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0102] In addition, each functional unit in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit.
[0103] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various media that can store program codes.
[0104] The above description is merely an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied to other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. A deployment method, characterized in that: include: Constructing a compilation task, and generating deployment service packages corresponding to the front-end and the server respectively based on the compilation task, wherein the compilation task uses an integrated project construction tool to compile a test version program package, and then compiles the test version program package; Providing a parameter configuration environment, configuring common parameters in the parameter configuration environment, wherein the common parameters are for deploying services of the same type; Creating at least one deployment task using the common parameters, each of the deployment tasks being used to deploy at least one service; Using the common parameters, selecting and inputting the deployment service package into the deployment task; Convert the deployment service package in the deployment task into a YAML file for service deployment.
2. The deployment method according to claim 1, characterized in that: The construction compilation task generates deployment service packages corresponding to the front-end and the server respectively based on the compilation task, including: Constructing a compilation task through a compilation server; wherein the compilation task includes: forming an integrated project construction tool, and compiling a corresponding test version program package through the integrated project construction tool; a code server receiving the test version program package, and sending the test version program package to the compilation server when the compilation server sends a request to the code server to obtain the test version program package; The compilation server compiles the test version program package and generates a front-end deployment service package corresponding to the front end and a back-end deployment service package corresponding to the server based on the compilation task; the front-end deployment service package includes a zip package and a mirror file; the back-end deployment service package includes a jar package and a war package.
3. The deployment method according to claim 1, wherein: Also includes: If application parameter configuration is required, configure the application parameters in the parameter configuration environment; The application parameters are for deploying multiple services to connect different data.
4. The deployment method according to claim 1, wherein: The selecting and inputting the deployment service package into the deployment task based on the common parameters includes: Based on the common parameter settings, a corresponding deployment service package is selected and input into a deployment task. Each deployment task deploys at least one service, that is, each deployment task corresponds to at least one deployment service package.
5. The deployment method according to claim 4, characterized in that: The input of the deployment service package is automatically selected or manually input; the manually input deployment service package address is the downloadable deployment service package address or the runnable deployment service package address.
6. The deployment method according to claim 1, wherein: The step of converting the deployment service package in the deployment task into a YAML file for service deployment includes: When executing the deployment task to deploy the service, the deployment service package is converted into a YAML file for service deployment; Alternatively, you can directly edit the YAML file to deploy the service when executing the deployment task for pipeline deployment.
7. A deployment system, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Software automatic deployment method and device
CN108897547A
Software deployment method and device, computer equipment and storage medium
CN112162753A