A synchronous packaging and deployment method and device based on VUE framework
Through a method based on the VUE framework, the micro-application service information collection is traversed and application objects are generated, which realizes the synchronous packaging and deployment of the main application and micro-application in the Vue project, solves the problem of missing micro-application deployment, and improves the packaging and deployment efficiency.
Patent Information
- Application Number
- CN202310339524.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-03-31
AI Technical Summary
In a Vue project, independent packaging and deployment of the main application and micro-applications can easily lead to missing deployment issues for a micro-application.
Through a method built on the VUE framework, the micro-application service information collection is traversed, application objects are generated and service resources are obtained, and the main application and micro-application are packaged and deployed with one click.
It solves the problem of missed deployment of micro-applications, improves packaging and deployment efficiency, and ensures the integrity and consistency of the main application and micro-applications.
Smart Images

Figure CN116301947B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of display technology, and in particular to a synchronous packaging and deployment method, device, storage medium and computer equipment based on a VUE framework. Background Art
[0002] In the related art, in a Vue project, the main application and micro-applications are usually in different projects, and the main application and micro-applications are independently packaged and deployed. Therefore, during the packaging and deployment process, there is a problem that the deployment of a micro-application is easily missed. Summary of the Invention
[0003] In order to solve at least one of the above problems, the first aspect of the present invention provides a synchronous packaging and deployment method based on the VUE framework, comprising:
[0004] In response to a first user operation, packaging and deploying a main application of a VUE project, wherein the VUE project is built based on a VUE framework;
[0005] Traverse the pre-set micro-application service information set of the VUE project, obtain the service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application.
[0006] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, before packaging and deploying the main application of the VUE project in response to the user's first operation, the synchronous packaging and deployment method further includes:
[0007] Encapsulate the configuration information of each micro-application of the VUE project and generate an application object;
[0008] Traverse the application objects and generate a micro-application service information set of the VUE project.
[0009] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, the encapsulating the configuration information of each micro-application of the VUE project and generating the application object further includes:
[0010] Search for the configuration files of each micro-application in the main application according to the registration information of each micro-application in the VUE project, and obtain the configuration information of each micro-application;
[0011] The configuration information of each micro-application is uniformly encapsulated to generate an application object, which includes the name, entry and service information of each micro-application. The service information includes server address, port number, user name, password, path and service resources.
[0012] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, traversing the application object and generating the micro-application service information set of the VUE project further includes:
[0013] Traversing the application objects and generating a property array including the identifier of each micro-application;
[0014] Establish a service information set array, use the micro-application identifiers of the attribute array as indexes, determine in turn whether the application object contains the service information attributes of each micro-application, move the included service information attributes to the service information set array and generate a micro-application service information set.
[0015] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, when the VUE project adds a new micro-application or modifies an existing micro-application, the synchronous packaging and deployment method further includes:
[0016] Updating the application object and the micro-application service information set;
[0017] In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
[0018] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, traversing the pre-set micro-application service information set of the VUE project, obtaining the service resources of each micro-application, and packaging and deploying the corresponding micro-application using the service resources further includes:
[0019] Traversing the micro-application service information set to obtain the service resource address of each micro-application;
[0020] Determine whether the service resource exists based on the service resource address of each micro-application.
[0021] If the service resource does not exist, the first prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued.
[0022] If the service resource exists, the second prompt information is returned and the service resource is executed to package and deploy the corresponding micro application.
[0023] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, if the service resource exists, returning the second prompt information and executing the service resource to package and deploy the corresponding micro-application further includes:
[0024] Trigger the packaging instruction of the service resource to compile and package the corresponding micro-application. If the packaging is unsuccessful, return the third prompt information and determine whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, continue traversing;
[0025] If the packaging is successful, the resource files of the micro-application are updated, and the deployment instructions of the service resources are triggered to call the deployer to remove the original resource files of the corresponding micro-application in the deployment server and deploy the updated resource files.
[0026] If the deployment is unsuccessful, the fourth prompt message is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued.
[0027] If the deployment is successful, the fifth prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal continues.
[0028] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, in response to a second user operation, a service resource of the service resource address of the micro-application is updated, and the second user operation is an operation received according to the first prompt information;
[0029] In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
[0030] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, the code of the micro-application is updated in response to a third user operation, and the third user operation is an operation received according to the third prompt information;
[0031] In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
[0032] For example, in the synchronous packaging and deployment method provided in some embodiments of the present application, the deployment server is detected in response to a fourth user operation, where the fourth user operation is an operation received according to the fourth prompt information;
[0033] In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
[0034] The second aspect of the present invention provides a synchronous packaging and deployment device using the synchronous packaging and deployment method as described in the first aspect, including a controller and a packaging and deployment unit, wherein
[0035] The controller is configured to respond to a first user operation, package and deploy the main application of the VUE project through the packaging and deployment unit, traverse a pre-set micro-application service information set of the VUE project, obtain service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application, wherein the VUE project is built based on the VUE framework.
[0036] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the synchronous packaging and deployment method as described in the first aspect.
[0037] A fourth aspect of the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the synchronous packaging and deployment method as described in the first aspect is implemented.
[0038] The beneficial effects of the present invention are as follows:
[0039] In response to the current existing problems, the present invention develops a synchronous packaging and deployment method and device based on the VUE framework. The embodiment provided by the present invention obtains service resources and generates a micro-application service information set by traversing each micro-application in the VUE project according to the main application and micro-application based on the VUE framework. The main application and micro-application are packaged and deployed with one click through the micro-application service information set, which can solve the problem of omitting micro-applications that need to be packaged and deployed in related technologies and has practical application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 A flowchart showing a synchronous packaging and deployment method according to an embodiment of the present invention is shown;
[0042] Figure 2 A schematic diagram showing the specific framework structure of the VUE project;
[0043] Figures 3a-3e A schematic diagram illustrating a VUE engineering code project of an independently deployed main application and at least one micro-application according to an embodiment of the present invention;
[0044] Figure 4 A structural block diagram of a synchronous packaging and deployment device according to an embodiment of the present invention is shown;
[0045] Figure 5 A schematic structural diagram of a computer device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0046] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the following detailed description is illustrative rather than restrictive and should not be used to limit the scope of protection of the present invention.
[0047] In response to the problems existing in related technologies, such as Figure 1 As shown, an embodiment of the present invention provides a synchronous packaging and deployment method based on the VUE framework, including:
[0048] In response to a first user operation, packaging and deploying a main application of a VUE project, wherein the VUE project is built based on a VUE framework;
[0049] Traverse the pre-set micro-application service information set of the VUE project, obtain the service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application.
[0050] Vue is a progressive JavaScript framework for building user interfaces. Designed to be applied layer by layer from the bottom up, Vue's core features include data-driven views, the MVVM pattern (M for the data model, V for the page view, and VM for the data model and view controller viewmodel), and component-based development. JavaScript is a lightweight, interpreted or just-in-time compiled programming language with a function-first approach that effectively improves development efficiency.
[0051] In this embodiment, the main application and micro-application based on the VUE framework obtain service resources by traversing each micro-application in the VUE project and generate a micro-application service information set. The micro-application service information set is used to realize one-click packaging and deployment of the main application and micro-application, which can solve the problem of missing micro-applications that need to be packaged and deployed in related technologies and has practical application value.
[0052] In a specific example, we will take the one-click packaging and deployment of the main application and micro-application of the VUE project as an example. Figure 2 The following shows the specific framework structure of the VUE project package.json, including multiple folders and file types, such as interface files api, resource files assets, layout files layout, routing files router, style files styles, etc., which are used to describe the specific information of the VUE project code project package.json. The VUE project includes a main application and at least one micro application, such as Figures 3a-3e As shown, the VUE project code project includes a main application and at least one micro application, specifically, Figure 3aAs shown, according to the specific framework structure of the VUE project, the main application A, the micro-application base, and the micro-application B and micro-application C are formed; Figure 3b The following is the folder of the main application A, which contains files such as page files, resource files assets, configuration files config, and routing files router; Figure 3c The following is a folder for micro-application B, which has an independent set of page files, resource files assets, routing files router and configuration files babel.config.js; Figure 3d The following is a folder of micro application C, which has an independent set of config files, page files, resource files assets and routing files router and other files; Figure 3e The following shows the specific content of the page file of the main application A, that is, the specific content of the micro-application base, where the microApp of microViews includes micro-application B and micro-application C, as shown in Figures 3a-3e It can be seen that the VUE project code is stored in different folders under package.json. In other words, micro application B and micro application C each include multiple independent folders, which are used to store the configuration files of micro application B and micro application C respectively.
[0053] As the basis for one-click packaging and configuration, pre-acquire the micro-application service information set, specifically:
[0054] First, encapsulate the configuration information of each micro-application of the VUE project and generate an application object, namely, an apps object.
[0055] In this embodiment, based on the VUE framework, the information of each micro-application scattered in the main application is collected and uniformly encapsulated into an apps object. Specifically, it includes:
[0056] First, the configuration files of each micro-application are searched according to the registration information of each micro-application in the main application in the VUE project, and the configuration information of each micro-application is obtained.
[0057] In this embodiment, based on the VUE framework, the configuration information of each micro-application is obtained through the page file of the main application A, that is, the specific content of the micro-application base.
[0058] Second, the configuration information of each micro-application is uniformly encapsulated to generate an application object, namely an apps object. The application object includes the name of each micro-application microApp1 and microApp2, the entry entry, and the service information server. The service information includes the server address url, port number port, username user, password password, path base, and service resource shell. For example:
[0059] In this embodiment, based on the VUE framework structure, the configuration information of each micro-application is obtained through the micro-application base.
[0060] Secondly, traverse the application objects and generate the micro-application service information set serverlist of the VUE project.
[0061] In this embodiment, the service information attributes of each micro-application in the VUE project are further determined by traversing the application object apps, and a micro-application service information set serverlist including the service information of each micro-application is obtained. Specifically, it includes:
[0062] First, traverse the application objects apps and generate a property array including the identifier microApp "n" of each micro-application.
[0063] In this embodiment, the server information of each micro-application is filtered out by traversing the application object apps, specifically including: using the native method Object.keys of js to traverse the application object apps object to obtain the attribute array of the apps object, such as ['microApp1', 'microApp2'].
[0064] Second, establish a service information collection array, use the micro-application identifier microApp "n" in the attribute array as the index, and determine in turn whether the application object contains the service information attributes of each micro-application, move the included service information attributes to the service information collection array respectively, and generate a micro-application service information collection serverlist.
[0065] In this embodiment, an empty array is established as a service information collection array. According to the micro-application identifiers in the attribute array, the js native method forEach is used to traverse the attribute array, and apps is further traversed with each micro-application identifier as an index. The js native method hasOwnProperty is used to determine whether the apps object contains the server attribute. If it does, the js array method push is used to put the server information into the array.
[0066] Get a micro-application service information set serverlist containing the packaging and deployment information of each micro-application, including the service information of each micro-application including server address url, port number port, user name user, password password, path base and service resource shell.
[0067] Based on the micro-application service information set serverlist of the VUE project, one-click packaging and deployment based on user operations are implemented when the main application is packaged and deployed:
[0068] The first step is to package and deploy the main application of the VUE project in response to the user's first operation.
[0069] In this embodiment, the packaging and deployment of the main application of the VUE project is triggered according to the user's operation, that is, the main application in the VUE project is packaged and deployed first.
[0070] The second step is to traverse the pre-set micro-application service information set of the VUE project, obtain the service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application.
[0071] In this embodiment, based on the packaging and deployment of the main application, the packaging and deployment of each micro-application is triggered according to the micro-application service information set of the VUE project obtained above. Specifically, it includes:
[0072] First, traverse the micro-application service information set to obtain the service resource address of each micro-application.
[0073] In this embodiment, the micro-application service information set serveList is traversed to obtain the address of each micro-application's shell script. The shell script is a pre-created .shell file named build.shell and contains the content "npmrun build". It exists in the root directory of the micro-application project, so this address is the root directory of the micro-application's project code address.
[0074] Second, determine whether the service resource exists based on the service resource address of each micro-application.
[0075] If the service resource does not exist, the first prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued.
[0076] If the service resource exists, the second prompt information is returned and the service resource is executed to package and deploy the corresponding micro application.
[0077] In this embodiment, the existence of the shell script of the micro-application is retrieved based on the address of the shell script. Specifically, the URL address of the shell file is requested using AJAX technology. If httpStatus returns 200, which is the second prompt information, it means that the resource request is successful and the shell script exists. If httpStatus returns 404, which is the first prompt information, it means that the resource request is unsuccessful.
[0078] In this embodiment, whether the service resource exists is determined based on the service resource address of each micro-application. If the service resource does not exist, the first prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If so, other micro-applications are continued to be traversed, otherwise the one-key packaging and deployment program is exited; if the service resource exists, the second prompt information is returned and the service resource is executed to package and deploy the corresponding micro-application, that is, the packaging and deployment of the micro-application is triggered and completed.
[0079] Specifically, when the second prompt information is received, the method further includes:
[0080] First, trigger the packaging instruction of the service resource to compile and package the corresponding micro-application. If the packaging is unsuccessful, return the third prompt information and determine whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, continue traversing.
[0081] In the present embodiment, for the existing service resource shell script, the service resource shell script is executed to trigger the packaging command npm run build. The packaging command starts the webpack tool in the micro-application project. Webpack is a static module packaging tool for JavaScript applications to compile and package the code. During the packaging process, if the packaging is successful, the address of the dist file is returned. If the packaging fails, the failure information is returned, for example, the failure information output by the webpack compiler is returned, i.e., the third prompt information, and then it is determined whether there are any micro-applications that have not been traversed. If so, it is determined whether the service resource shell script of the micro-application exists. If so, it is determined whether the service resource shell script of the micro-application exists. If so, the next micro-application is packaged.
[0082] Second, if the packaging is successful, the resource files of the micro-application are updated, and the deployment instructions of the service resources are triggered to call the deployer to remove the original resource files of the corresponding micro-application in the deployment server and deploy the updated resource files.
[0083] If the deployment is unsuccessful, the fourth prompt message is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued.
[0084] If the deployment is successful, the fifth prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal continues.
[0085] In this embodiment, the deployment function is implemented through a deployer. First, the server address, port number, username and password in the micro-application service information server are used to connect to the server. When the server connection is successful, a shell script is executed to remove the original dist file and dist compressed package. Then, the newly packaged dist file is uploaded to the server and the domain name is configured to complete the deployment. If the deployment is unsuccessful, a prompt message is returned to indicate that the micro-application deployment failed, that is, the fourth prompt message is used for prompting. If the deployment is successful, the fifth prompt message is returned to indicate that the micro-application deployment was successful.
[0086] In this embodiment, according to the above-mentioned traversal operation, the packaging and deployment of each micro-application is realized through a loop, so that when the main application is packaged and deployed, the packaging and deployment of each micro-application is realized, avoiding the problem of missing micro-applications that need to be packaged and deployed in related technologies, and effectively improving the packaging and deployment efficiency.
[0087] At this point, one-click packaging and deployment of the main application and micro-application of the VUE project is achieved. According to the synchronous packaging and deployment method of the above embodiment, the main application and micro-application based on the VUE framework can obtain service resources and generate a micro-application service information set by traversing each micro-application in the VUE project. The main application and micro-application can be packaged and deployed with one click through the micro-application service information set, which can solve the problem of missing micro-applications that need to be packaged and deployed in related technologies and effectively improve the packaging and deployment efficiency.
[0088] In an optional embodiment, during the one-click packaging and deployment process, when the first prompt information is received, the service resources of the service resource address of the micro-application are updated in response to the user's second operation, and the main application and each micro-application of the VUE project are repackaged and deployed in response to the user's first operation.
[0089] In this embodiment, when a first prompt message is received indicating that the service resource address of the micro-application does not contain a service resource, the service resource is uploaded again according to the prompt to ensure that the service resource is valid. Then, according to the user's first operation, the one-click packaging and deployment is re-executed, that is, the main application and micro-application are packaged and deployed again through the one-click packaging and deployment, ensuring the integrity of the packaging and deployment of the main application and micro-application, avoiding the problem of missing micro-applications that need to be packaged and deployed in related technologies, and effectively improving the packaging and deployment efficiency.
[0090] It is worth noting that those skilled in the art should understand that when receiving the first prompt information, the user can also manually troubleshoot and solve the problem and manually package and deploy the unpackaged and deployed micro-applications. This application does not make specific limitations on this and will not go into details here.
[0091] Similarly, in an optional embodiment, during the one-click packaging and deployment process, when a third prompt message is received, the code of the micro-application is updated in response to the user's third operation, and the main application and each micro-application of the VUE project are repackaged and deployed in response to the user's first operation.
[0092] In this embodiment, when a third prompt message is received indicating that the packaging of the micro-app was unsuccessful, the micro-app code is updated again according to the prompt, for example, by updating the functional code or updating the dependencies. Then, according to the user's first operation, the one-click packaging and deployment is re-executed, that is, the main application and the micro-app are packaged and deployed again through the one-click packaging and deployment, ensuring the integrity of the packaging and deployment of the main application and the micro-app, avoiding the problem of missing micro-apps that need to be packaged and deployed in related technologies, and effectively improving the packaging and deployment efficiency.
[0093] Similarly, in an optional embodiment, during the one-click packaging and deployment process, when the fourth prompt information is received, the deployment server is detected in response to the user's fourth operation, and the main application and each micro-application of the VUE project are repackaged and deployed in response to the user's first operation.
[0094] In this embodiment, when a fourth prompt message is received, indicating that the deployment of the micro-app was unsuccessful, the user checks the deployment server for proper connection and network issues based on the prompt to ensure normal communication with the deployment server. Then, based on the user's first operation, the one-click packaging and deployment is re-executed, i.e., the main application and micro-app are packaged and deployed again through the one-click packaging and deployment. This ensures the integrity of the packaging and deployment of the main application and micro-app, avoids the problem of missing micro-apps that need to be packaged and deployed in related technologies, and effectively improves packaging and deployment efficiency.
[0095] Taking into account the situation where new micro-applications are added to the VUE project, or existing micro-applications are modified and updated, in an optional embodiment, the synchronous packaging and deployment method also includes: updating the application object and the micro-application service information set; and repackaging and deploying the main application and each micro-application of the VUE project in response to the user's first operation.
[0096] In this embodiment, in order to address the problems of adding new micro-applications, updating or maintaining micro-applications in the VUE project, the application object apps is updated, and then the micro-application service information set is updated according to the updated apps object. Based on the updated micro-application service information set, the main application and micro-application are packaged and deployed again through the user's first operation, that is, the main application and micro-application are packaged and deployed with one click to ensure their normal operation, making the update, packaging and deployment operations of the VUE project more convenient and faster, effectively improving R&D and maintenance efficiency, and improving user experience.
[0097] Corresponding to the synchronous packaging and deployment method provided in the above embodiment, an embodiment of the present application further provides a synchronous packaging and deployment device applying the above synchronous packaging and deployment method, such as Figure 4 As shown, it includes a controller and a packaging and deployment unit, wherein the controller is configured to respond to a first operation of the user, package and deploy the main application of the VUE project through the packaging and deployment unit, traverse the pre-set micro-application service information set of the VUE project, obtain the service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application, and the VUE project is built based on the VUE framework.
[0098] In this embodiment, according to the main application and micro-application based on the VUE framework, the packaging and deployment unit traverses the micro-applications in the VUE project to obtain service resources and generate a micro-application service information set. The micro-application service information set is used to implement one-click packaging and deployment of the main application and micro-application, which can solve the problem of missing micro-applications that need to be packaged and deployed in related technologies and has practical application value.
[0099] Since the synchronous packaging and deployment device provided in the embodiment of the present application corresponds to the synchronous packaging and deployment method provided in the above-mentioned embodiments, the previous implementation method is also applicable to the synchronous packaging and deployment device provided in this embodiment and will not be described in detail in this embodiment.
[0100] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: packaging and deploying a main application of a VUE project in response to a first operation of a user, wherein the VUE project is built based on a VUE framework; traversing a pre-set micro-application service information set of the VUE project, obtaining service resources of each micro-application, and utilizing the service resources to package and deploy corresponding micro-applications.
[0101] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0102] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0103] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0104] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0105] like Figure 5As shown, a structural diagram of a computer device provided by another embodiment of the present invention. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0106] like Figure 5 As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0107] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0108] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0109] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 5 Not shown, often called a "hard drive"). Although Figure 5 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0110] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.
[0111] The computer device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0112] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a synchronous packaging and deployment method based on the VUE framework provided in an embodiment of the present invention.
[0113] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims
1. A synchronous packaging and deployment method based on the VUE framework, characterized in that: include: In response to a first user operation, packaging and deploying a main application of a VUE project, wherein the VUE project is built based on a VUE framework; Traverse the pre-set micro-application service information set of the VUE project, obtain the service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application; Before packaging and deploying the main application of the VUE project in response to the user's first operation, the synchronous packaging and deployment method further includes: Encapsulate the configuration information of each micro-application of the VUE project and generate an application object; Traverse the application objects and generate a micro-application service information set of the VUE project; The encapsulating the configuration information of each micro-application of the VUE project and generating an application object further includes: Search for the configuration files of each micro-application in the main application according to the registration information of each micro-application in the VUE project, and obtain the configuration information of each micro-application; The configuration information of each micro-application is uniformly encapsulated to generate an application object, wherein the application object includes the name, entry and service information of each micro-application, and the service information includes the server address, port number, user name, password, path and service resources; The traversing the application object and generating the micro-application service information set of the VUE project further includes: Traversing the application objects and generating a property array including the identifier of each micro-application; Establish a service information set array, use the micro-application identifiers of the attribute array as indexes, determine in turn whether the application object contains the service information attributes of each micro-application, move the included service information attributes to the service information set array and generate a micro-application service information set.
2. The synchronous packaging and deployment method according to claim 1, characterized in that: When the VUE project adds a new micro-application or modifies an existing micro-application, the synchronous packaging and deployment method further includes: Updating the application object and the micro-application service information set; In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
3. The synchronous packaging and deployment method according to any one of claims 1-2, characterized in that: The traversing the preset micro-application service information set of the VUE project, obtaining the service resources of each micro-application, and packaging and deploying the corresponding micro-application using the service resources further includes: Traversing the micro-application service information set to obtain the service resource address of each micro-application; Determine whether the service resource exists based on the service resource address of each micro-application. If the service resource does not exist, the first prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued. If the service resource exists, the second prompt information is returned and the service resource is executed to package and deploy the corresponding micro application.
4. The synchronous packaging and deployment method according to claim 3, characterized in that: If the service resource exists, returning the second prompt information and executing the service resource to package and deploy the corresponding micro application further includes: Trigger the packaging instruction of the service resource to compile and package the corresponding micro-application. If the packaging is unsuccessful, return the third prompt information and determine whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, continue traversing; If the packaging is successful, the resource files of the micro-application are updated, and the deployment instructions of the service resources are triggered to call the deployer to remove the original resource files of the corresponding micro-application in the deployment server and deploy the updated resource files. If the deployment is unsuccessful, the fourth prompt message is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal is continued. If the deployment is successful, the fifth prompt information is returned and it is determined whether there are any micro-applications that have not been traversed. If there are any micro-applications that have not been traversed, the traversal continues.
5. The synchronous packaging and deployment method according to claim 3, characterized in that: updating the service resource of the service resource address of the micro-application in response to a second user operation, wherein the second user operation is an operation received according to the first prompt information; In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
6. The synchronous packaging and deployment method according to claim 4, characterized in that: Updating the code of the micro-application in response to a third user operation, where the third user operation is an operation received according to the third prompt information; In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
7. The synchronous packaging and deployment method according to claim 4, characterized in that: detecting the deployment server in response to a fourth user operation, wherein the fourth user operation is an operation received according to the fourth prompt information; In response to the user's first operation, the main application and each micro-application of the VUE project are repackaged and deployed.
8. A synchronous packaging and deployment device using the synchronous packaging and deployment method according to any one of claims 1 to 7, characterized in that: Includes controller and package deployment unit, where The controller is configured to respond to a first user operation, package and deploy the main application of the VUE project through the packaging and deployment unit, traverse a pre-set micro-application service information set of the VUE project, obtain service resources of each micro-application, and use the service resources to package and deploy the corresponding micro-application, wherein the VUE project is built based on the VUE framework.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the synchronous packaging and deployment method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the synchronous packaging and deployment method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and system for automatically deploying go micro-service
CN114398075A
Application packaging deployment method and system
CN115080062A