CN115129326A - Sub-project independent deployment method and device and storage medium - Google Patents

Sub-project independent deployment method and device and storage medium Download PDF

Info

Publication number
CN115129326A
CN115129326A CN202210760631.8A CN202210760631A CN115129326A CN 115129326 A CN115129326 A CN 115129326A CN 202210760631 A CN202210760631 A CN 202210760631A CN 115129326 A CN115129326 A CN 115129326A
Authority
CN
China
Prior art keywords
version
sub
code
version code
project
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210760631.8A
Other languages
Chinese (zh)
Inventor
马春荃
俞德明
陈苍山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hesi Information Technology Co Ltd
Original Assignee
Beijing Hesi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Hesi Information Technology Co Ltd filed Critical Beijing Hesi Information Technology Co Ltd
Priority to CN202210760631.8A priority Critical patent/CN115129326A/en
Publication of CN115129326A publication Critical patent/CN115129326A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method, a device and a storage medium for independent deployment of sub-projects, wherein the method for independent deployment of sub-projects comprises the following steps: acquiring first version information and file information of a sub-project to be deployed; according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code; and replacing an incoming file path of the Nginx service according to the first version code. Therefore, the deployment speed is improved in a multiple mode, the situation that a whole web project is packaged for multiple times to generate a new construction product can be avoided, the occupation of storage is reduced, the development and deployment efficiency can be improved, and research and development resources are saved.

Description

Sub-project independent deployment method and device and storage medium
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for independently deploying sub-projects and a storage medium.
Background
With the continuous increase of company services and update iteration, the code amount of the front end becomes larger and difficult to manage, so that a front end project needs to be subjected to micro front end splitting, one main project splits different plugin sub front end projects according to functions and services, only the changed sub front end project needs to be changed during development, and the starting and compiling speed of the project can be increased. In the prior art, in a project deployment stage, codes of a main project and sub projects are all packaged and enter one docker mirror image package, then resource access is performed through Nginx, and the whole project is deployed after the sub projects are modified and recompiled and packaged into the docker mirror image package, so that the whole process takes a long time, and development and deployment efficiency is reduced.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and a storage medium for independent deployment of a sub-project, so as to solve the problem in the prior art that deployment of a modified sub-project requires recompilation and packing of a whole project into a docker mirror package, which reduces development and deployment efficiency.
To achieve the above object, an embodiment of the present application provides a method for independent deployment of sub-projects, including: acquiring first version information and file information of a sub-project to be deployed; according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code; and replacing an incoming file path of the Nginx service according to the first version code.
Optionally, the method for generating the first version information of the sub-item to be deployed includes: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging.
Optionally, the method for replacing the incoming file path of the Nginx service includes: html incoming file path in the nginnx service web master entry.
Optionally, before placing the first version code at a corresponding location of a Nginx service to replace the current second version code, the method further includes: and recording information corresponding to the second version code.
Optionally, after replacing the incoming file path of the Nginx service, further comprising: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a corresponding position of the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
To achieve the above object, the present application further provides a sub-project independent deployment apparatus, including: a memory; and
a processor coupled to the memory, the processor configured to:
acquiring first version information and file information of a sub-project to be deployed; according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code; and replacing an incoming file path of the Nginx service according to the first version code.
Optionally, the processor is further configured to: the method for generating the first version information of the sub-item to be deployed comprises the following steps: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging.
Optionally, the processor is further configured to: the method of replacing the incoming file path of the Nginx service includes: html incoming file path in the nginnx service web master entry.
Optionally, the processor is further configured to: before placing the first version code at a corresponding location of a Nginx service to replace the current second version code, further comprising: recording information corresponding to the second version code; after replacing the incoming file path of the Nginx service, further comprising: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a position corresponding to the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
To achieve the above object, the present application also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a machine, implements the steps of the method as described above.
The embodiment of the application has the following advantages:
1. the embodiment of the application provides a method for independently deploying sub-projects, which comprises the following steps: acquiring first version information and file information of a sub-project to be deployed; according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code; and replacing an incoming file path of the Nginx service according to the first version code.
Compared with the scheme that the sub-projects are modified and then are packaged and then deployed integrally in the prior art, the method has the advantages that the deployment speed is improved in a double mode, the situation that the whole web project is packaged for multiple times to generate new construction products can be avoided, the occupation of storage is reduced, the development and deployment efficiency can be improved, and research and development resources are saved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It should be apparent that the drawings in the following description are merely exemplary, and that other embodiments can be derived from the drawings provided by those of ordinary skill in the art without inventive effort.
Fig. 1 is a flowchart of a method for independent sub-project deployment according to an embodiment of the present disclosure;
fig. 2 is an operation interface diagram for acquiring first version information and file information of a sub-project to be deployed according to the method for independently deploying a sub-project provided in the embodiment of the present application;
fig. 3 is a deployment operation interface diagram of a sub-project independent deployment method according to an embodiment of the present application;
fig. 4 is a deployment flowchart of a method for independent sub-project deployment according to an embodiment of the present application;
fig. 5 is a view of a version rollback operation interface of a method for independent deployment of child projects according to an embodiment of the present application;
fig. 6 is a block diagram of a sub-project independent deployment apparatus according to an embodiment of the present disclosure.
Detailed Description
The present disclosure is not intended to be limited to the particular embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In addition, the technical features mentioned in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
An embodiment of the present application provides a method for independent deployment of sub-projects, and referring to fig. 1, fig. 1 is a flowchart of a method for independent deployment of sub-projects provided in an embodiment of the present application, it should be understood that the method may further include additional blocks not shown and/or may omit blocks shown, and the scope of the present application is not limited in this respect.
At step 101, first version information and file information of a sub-project to be deployed are obtained.
In some embodiments, the method of generating the first version information of the sub-item to be deployed includes: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging. Specifically, after the development of the current sub-item is completed, the code is compiled and then packaged and uploaded to npm, and referring to fig. 2, the first version information and the file information are uploaded to the independent deployment system for recording during packaging.
At step 102, according to the first version information, the first version code of the corresponding sub-item is obtained from the code repository of npm, and the first version code is placed in the corresponding position of the Nginx service to replace the current second version code.
Specifically, the sub-project to be deployed and the corresponding first version are selected through the sub-project independent deployment system, the first version information is inquired through the database, then the code is pulled from the code warehouse and placed at the corresponding position of the service to replace the original file, and the specific operation interface refers to fig. 3. Taking the deployment flow chart of the sub-project independent deployment method provided in fig. 4 as an example, plug-a v 1.01.01 is updated to v1.1.0, and plug-b v1.2.0 is updated to v2.0.0.
At step 103, the incoming file path of the Nginx service is replaced according to the first version code.
In some embodiments, the method of replacing the incoming file path of a Nginx service comprises: html in the Nginx service web main project entrance is replaced, so that a docker mirror image is not packaged again, and new codes of sub projects can be directly deployed. Specifically, refer to fig. 4 for a deployment flow chart of a method for independent sub-project deployment.
In some embodiments, before placing the first version code at a corresponding location of a Nginx service to replace the current second version code, further comprising: and recording information corresponding to the second version code. In some embodiments, after replacing the incoming file path of the Nginx service, further comprising: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a position corresponding to the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
Specifically, all sub-project information of the current version is recorded during deployment, and when the versions are rolled back, the sub-project version difference information of the two deployed versions is compared, and the rolling back is performed by using the deployment method, and a specific operation interface refers to fig. 5.
The independent deployment system corresponding to the sub-project independent deployment method described in the foregoing embodiment is a node service, and is in the same docker system together with a web file, and when the docker is started, the node service is also started. The original development and deployment mode is that a plugin code is changed, then the packaging, docker packaging and docker deployment of a web master project are carried out during the period from packaging to online deployment, the time is basically more than 5 minutes, if the system is independently deployed, only npm files need to be downloaded to replace the files and paths, the deployment is finished basically within 2 minutes, and the efficiency difference of the period is very large.
Compared with the scheme of modifying the sub-project and then integrally packing and re-deploying in the prior art, the method has the advantages that the deploying speed is improved in a multiple mode, the situation that the whole web project is packed for multiple times to generate new construction products can be avoided, the occupation of storage is reduced, the developing and deploying efficiency is improved, and research and development resources are saved.
Fig. 6 is a block diagram of modules of a sub-project independent deployment apparatus according to an embodiment of the present disclosure. The device includes:
a memory 201; and a processor 202 coupled to the memory 201, the processor 202 configured to: acquiring first version information and file information of a sub-project to be deployed; according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code; and replacing an incoming file path of the Nginx service according to the first version code.
In some embodiments, the processor 202 is further configured to: the method for generating the first version information of the sub-item to be deployed comprises the following steps: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging.
In some embodiments, the processor 202 is further configured to: the method of replacing the incoming file path of the Nginx service includes: html incoming file path in the nginnx service web master entry.
In some embodiments, the processor 202 is further configured to: before the first version code is placed at a corresponding position of the Nginx service to replace the current second version code, the method further comprises the following steps: recording information corresponding to the second version code; after replacing the incoming file path of the Nginx service, further comprising: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a position corresponding to the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
For the specific implementation method, reference is made to the foregoing method embodiments, which are not described herein again.
The present application may be methods, apparatus, systems, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for carrying out various aspects of the present application.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present application may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry can execute computer-readable program instructions to implement aspects of the present application by utilizing state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present application are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It is noted that, unless expressly stated otherwise, all features disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose. Thus, unless expressly stated otherwise, each feature disclosed is one example only of a generic series of equivalent or similar features. Where used, it is further preferred, even further and more preferred that the brief introduction of the further embodiment is made on the basis of the preceding embodiment, the contents of which further, preferably, even further or more preferred the rear band is combined with the preceding embodiment as a complete constituent of the further embodiment. Several further, preferred, still further or more preferred arrangements of the back tape of the same embodiment may be combined in any combination to form a further embodiment.
Although the present application has been described in detail with respect to the general description and the specific embodiments, it will be apparent to those skilled in the art that some modifications or improvements may be made based on the present application. Accordingly, such modifications and improvements are intended to be within the scope of this invention as claimed.

Claims (10)

1. A method for independent deployment of sub-projects, comprising the steps of:
acquiring first version information and file information of a sub-project to be deployed;
according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code;
and replacing an incoming file path of the Nginx service according to the first version code.
2. The method according to claim 1, wherein the method for generating the first version information of the sub-project to be deployed comprises: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging.
3. The sub-project independent deployment method of claim 1 wherein the method of replacing the incoming file path of a Nginx service comprises: html incoming file path in the nginnx service web master entry.
4. The sub-project independent deployment method according to claim 1, wherein before placing the first version code at the corresponding location of the Nginx service to replace the current second version code, further comprising: and recording information corresponding to the second version code.
5. The sub-project independent deployment method according to claim 4, further comprising, after replacing the incoming file path of a Nginx service: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a position corresponding to the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
6. A sub-project independent deployment apparatus, comprising:
a memory; and
a processor coupled to the memory, the processor configured to:
acquiring first version information and file information of a sub-project to be deployed;
according to the first version information, acquiring a first version code of the corresponding sub-item from a code warehouse of npm, and placing the first version code at a corresponding position of the Nginx service to replace a current second version code;
and replacing an incoming file path of the Nginx service according to the first version code.
7. The sub-project independent deployment apparatus of claim 6, wherein the processor is further configured to: the method for generating the first version information of the sub-item to be deployed comprises the following steps: compiling and packaging the first version codes of the developed sub-items, and generating corresponding first version information during packaging.
8. The sub-project independent deployment apparatus of claim 6, wherein the processor is further configured to: the method of replacing the incoming file path of the Nginx service includes: html incoming file path in the nginnx service web master entry.
9. The sub-project independent deployment apparatus of claim 6, wherein the processor is further configured to: before the first version code is placed at a corresponding position of the Nginx service to replace the current second version code, the method further comprises the following steps: recording information corresponding to the second version code; after replacing the incoming file path of the Nginx service, further comprising: and acquiring a version rollback instruction, acquiring the second version code according to the information corresponding to the second version code, placing the second version code at a position corresponding to the Nginx service to replace the current first version code, and replacing the lead-in file path of the Nginx service according to the second version code.
10. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a machine, implements the steps of the method of any of claims 1 to 5.
CN202210760631.8A 2022-06-29 2022-06-29 Sub-project independent deployment method and device and storage medium Pending CN115129326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210760631.8A CN115129326A (en) 2022-06-29 2022-06-29 Sub-project independent deployment method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210760631.8A CN115129326A (en) 2022-06-29 2022-06-29 Sub-project independent deployment method and device and storage medium

Publications (1)

Publication Number Publication Date
CN115129326A true CN115129326A (en) 2022-09-30

Family

ID=83380989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210760631.8A Pending CN115129326A (en) 2022-06-29 2022-06-29 Sub-project independent deployment method and device and storage medium

Country Status (1)

Country Link
CN (1) CN115129326A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501335A (en) * 2023-06-28 2023-07-28 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501335A (en) * 2023-06-28 2023-07-28 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system
CN116501335B (en) * 2023-06-28 2023-09-19 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system

Similar Documents

Publication Publication Date Title
US11029975B2 (en) Automated container image assembly
US20200285451A1 (en) Decoupling microservices from a monolithic application
CN107609004B (en) Application program embedding method and device, computer equipment and storage medium
CN112764753B (en) Project deployment method and device, electronic equipment and storage medium
US10289395B2 (en) Performing a compiler optimization pass as a transaction
US11461291B2 (en) Method, electronic device and computer program product for processing machine learning model
US11089000B1 (en) Automated source code log generation
CN111538545B (en) Java application running method, java application running device, java application running medium and electronic equipment
CN110502239A (en) A kind of method for developing and producing and device of onboard system SDK
CN112906206B (en) Digital twin model construction method and device
CN115617420B (en) Application program generation method, device, equipment and storage medium
CN115129326A (en) Sub-project independent deployment method and device and storage medium
CN112035160A (en) Code management system and control method thereof
CN110795143B (en) Method, apparatus, computing device, and medium for processing functional modules
US11416455B2 (en) Version control of electronic files defining a model of a system or component of a system
CN112965713B (en) Development method, device, equipment and storage medium of visual editor
CN110457065A (en) For obtaining the method and device of compatible multi version systematic difference
CN111191225B (en) Method, device, medium and electronic equipment for switching isolated objects
US11157257B2 (en) Automatic cloning of Conda environment into Docker image
CN113127000A (en) Compiling method, device and equipment of application program assembly and storage medium
US11651030B2 (en) Delta-based conflict-free replicated data type arrays using dot stores that map dots to dot stores
CN115373731A (en) Public code resource sharing method, device, equipment and storage medium
CN110162761B (en) Collaborative editing method, device and equipment for document and storage medium
CN113641395A (en) Method, device and equipment for packaging deployment under micro front end architecture and readable medium
CN111966592A (en) Front-end page testing method, device, medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination