CN-121979534-A - Online compiling and packaging method, system, equipment and storage medium
Abstract
The application discloses an online compiling and packaging method, a system, equipment and a storage medium, which belong to the technical field of industrial Internet of things, wherein the online compiling and packaging method comprises the steps of acquiring a packaging task request triggered by a user; the method comprises the steps of constructing a container according to a packing task request, pulling target codes from a remote code bin library into the container, wherein the target codes are the latest codes in the remote code bin, and executing a preset packing compiling script according to the packing task request and the target codes in the container to generate a front-end project and/or a packing product corresponding to a back-end project. According to the online compiling and packaging method provided by the embodiment of the application, the container is constructed according to the packaging task request triggered by the user, and the compiling and packaging are automatically realized in the container, so that the manual intervention is reduced, the compiling and packaging efficiency and automation are improved, and the reliable compiling and packaging method suitable for front-end and rear-end separation architecture can be provided.
Inventors
- FENG HUABIN
- LI WENRONG
- LU MINGZHOU
- LIU ZHONGYIN
- WANG WEIMING
- QIAN ZEQUN
Assignees
- 中国船舶集团有限公司第七一一研究所
Dates
- Publication Date
- 20260505
- Application Date
- 20260109
Claims (12)
- 1. The online compiling and packing method is characterized by being applied to a front-end and back-end separation architecture, wherein the front-end and back-end separation architecture comprises a front-end item and a back-end item, and the method comprises the following steps: acquiring a packing task request triggered by a user; Constructing a container according to the packaging task request; Pulling an object code from a remote code bin into the container, wherein the object code is the latest code in the remote code bin; and executing a preset packing compiling script in the container according to the packing task request and the target code to generate the front-end item and/or a packing product corresponding to the back-end item.
- 2. The method of claim 1, wherein executing a preset packaging compilation script in accordance with the packaging task request and the object code comprises: Determining a packaging type according to the packaging task request; Transmitting the packaging type as a command line parameter to the preset packaging compiling script; And executing the preset packaging compiling script according to the command line parameters and the target code.
- 3. The method of claim 2, wherein the package type comprises at least one of an Electron client package and a JAR package.
- 4. The method of claim 2, wherein the command line parameters include a packaged first application and a packaged second application; the executing the preset package compiling script according to the command line parameters and the target code comprises the following steps: Executing first packing logic under the condition that the command line parameter is the packing first application; and executing second packing logic in the case that the command line parameter is the packing second application.
- 5. The method of claim 4, wherein the executing the first packing logic comprises: Pulling a front end code of the front end item; And sequentially performing front-end dependency installation, front-end compilation, first packing and client file collection to generate a first packing product.
- 6. The method of claim 4, wherein the executing the second packing logic comprises: pulling a front end code of the front end item and a back end code of the back end item; And sequentially performing the install front-end dependency, front-end compilation, and performing a second packaging to generate a second packaged product.
- 7. The method of claim 6, wherein performing the second packaging comprises moving the distribution catalog to a back-end catalog, back-end packaging, collecting JARs, and configuring.
- 8. The method of claim 4, wherein the packaged first application is a packaged Electron application and the packaged second application is a packaged Web application.
- 9. An online compiling and packing system is characterized by being applied to a front-end and back-end separation architecture, wherein the front-end and back-end separation architecture comprises a front-end item and a back-end item, and the system comprises: the acquisition module is used for acquiring a packing task request triggered by a user; the construction module is used for constructing a container according to the packaging task request; the pulling module is used for pulling an object code from a remote code bin library into the container, wherein the object code is the latest code in the remote code bin; and the generation module is used for executing a preset packaging compiling script in the container according to the packaging task request and the target code so as to generate the front-end item and/or a packaging product corresponding to the back-end item.
- 10. The system of claim 9, further comprising a user interface for providing a packaging type selection interface and a trigger interface for the packaging task request, and compiling real-time recording and archiving of packaging.
- 11. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program which, when executed by the processor, implements the method of any of claims 1-8.
- 12. A computer readable storage medium, having stored thereon a computer program, the computer program being loaded by a processor to perform the steps of the method according to any of claims 1-8.
Description
Online compiling and packaging method, system, equipment and storage medium Technical Field The application relates to the technical field of industrial Internet of things, in particular to an online compiling and packaging method, an online compiling and packaging system, online compiling and packaging equipment and a storage medium. Background With the wide application of front-end and back-end separation architecture in modern Web systems, the deployment and release processes of the system become more complex. The packaging deployment of front-end and back-end separate projects typically requires a developer to manually perform multiple independent steps, including front-end compilation, resource replication, back-end packaging, etc., which is not only inefficient, but also prone to build failure due to environmental differences. Therefore, there is a need to provide a reliable compilation packaging scheme suitable for front-end and back-end split architectures. Disclosure of Invention An online compiling and packing method, system, device and storage medium are provided to provide a reliable compiling and packing method suitable for front-end and back-end separation architecture. In a first aspect, an online compiling and packaging method is provided, and is applied to a front-end and back-end separation architecture, wherein the front-end and back-end separation architecture comprises a front-end item and a back-end item, and the method comprises the following steps: acquiring a packing task request triggered by a user; Constructing a container according to the packaging task request; pulling an object code from a remote code bin into the container, wherein the object code is the latest code in the remote code bin; And executing a preset packing compiling script in the container according to the packing task request and the target code to generate a front-end item and/or a packing product corresponding to the back-end item. In some embodiments, executing the preset packaging compilation script according to the packaging task request and the object code includes: determining a packaging type according to the packaging task request; transmitting the packaging type as a command line parameter to a preset packaging compiling script; And executing a preset packaging compiling script according to the command line parameters and the target code. In some embodiments, the package type includes at least one of an Electron client package and a JAR package. In some embodiments, the command line parameters include a packaged first application and a packaged second application; executing a preset package compiling script according to the command line parameters and the target code, wherein the method comprises the following steps: Executing first packing logic under the condition that the command line parameter is a packing first application; In the case where the command line parameter is a packed second application, second packing logic is executed. In some embodiments, performing the first packing logic includes: pulling a front-end code of a front-end item; And sequentially performing front-end dependency installation, front-end compilation, first packing and client file collection to generate a first packing product. In some embodiments, executing the second packing logic includes: pulling a front end code of a front end item and a back end code of a back end item; And sequentially performing the install front-end dependency, front-end compilation, and performing a second packaging to generate a second packaged product. In some embodiments, performing the second packaging includes moving the distribution catalog to a back-end catalog, back-end packaging, collecting JARs, and configuration. In some embodiments, the packaged first application is a packaged Electron application and the packaged second application is a packaged Web application. In a second aspect, an online compiling and packaging system is provided, and is applied to a front-end and back-end separation architecture, wherein the front-end and back-end separation architecture comprises a front-end item and a back-end item, and the system comprises: the acquisition module is used for acquiring a packing task request triggered by a user; the construction module is used for constructing a container according to the packaging task request; the pulling module is used for pulling the target code from the remote code bin library into the container, wherein the target code is the latest code in the remote code bin; And the generating module is used for executing a preset packing compiling script in the container according to the packing task request and the target code so as to generate a front-end item and/or a packing product corresponding to the back-end item. In a third aspect, there is also provided an electronic device comprising a memory and a processor, the memory having stored thereon a computer program which, when executed by the processor, implem