CN112783514B - Method and system for deployment management of web front-end project - Google Patents

Method and system for deployment management of web front-end project Download PDF

Info

Publication number
CN112783514B
CN112783514B CN202011633136.8A CN202011633136A CN112783514B CN 112783514 B CN112783514 B CN 112783514B CN 202011633136 A CN202011633136 A CN 202011633136A CN 112783514 B CN112783514 B CN 112783514B
Authority
CN
China
Prior art keywords
project
zip
node
dist
request packet
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.)
Active
Application number
CN202011633136.8A
Other languages
Chinese (zh)
Other versions
CN112783514A (en
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.)
Ropt Technology Group Co ltd
Ropt Xiamen Big Data Group Co ltd
Original Assignee
Lop Xiamen System Integration Co ltd
Ropt Technology Group 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 Lop Xiamen System Integration Co ltd, Ropt Technology Group Co ltd filed Critical Lop Xiamen System Integration Co ltd
Priority to CN202011633136.8A priority Critical patent/CN112783514B/en
Publication of CN112783514A publication Critical patent/CN112783514A/en
Application granted granted Critical
Publication of CN112783514B publication Critical patent/CN112783514B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/542Intercept

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a system for managing deployment of a web front-end project, which comprise the steps of storing project information in a form of a local JSON file, intercepting a request through a routing function of expressJS, and receiving form information by using formulable to operate the project information in a memory; remotely logging in a target server by using a node-ssh to obtain the operation authority of the target server; intercepting a request packet dist.zip through a routing function of express JS, and backing up and deleting an old version of project file in a target server by using node-ssh; and (4) fragment uploading and decompressing the request packet dist.zip based on a fragment continuous transmission algorithm, and finally annotating the node insertion anchor point needing to be managed in the Nginx configuration file through regular operation, so that the installed Nginx server is managed.

Description

Method and system for deployment management of web front-end project
Technical Field
The invention relates to the technical field of Web front ends, in particular to a method and a system for deploying and managing a Web front-end project.
Background
Currently, the development of a front-end and back-end separation mode has become a mainstream, and a web front-end project is generally hosted under an Nginx server. When the target server is required to be logged in during deployment, operations such as Nginx configuration modification, Nginx restart and the like are required. When the version is released, the previous front-end deployment package needs to be backed up, deleted, uploaded, decompressed and the like.
The above-mentioned deployment operation and maintenance procedures are rather complicated and cumbersome. Although there are popular deployment platforms such as jenkins on the market at present, the jenkins deployment and configuration process is rather cumbersome and requires a lot of configurations. Jenkins are based on a management platform for continuous integration and continuous delivery, and are not specific to web front-end projects. It is too bulky for simple web front-end deployment. Jenkins does not support the installation of Nginx, and the operations of downloading and modifying Nginx configuration files, restarting and the like.
Disclosure of Invention
The invention provides a method and a system for deploying and managing a web front-end project, which aim to overcome the defects of the prior art.
In one aspect, the present invention provides a method for web front-end project deployment management, the method comprising:
storing project information in a local JSON file form by utilizing a node.js fs module before starting a web front-end project, and reading the project information in the local JSON file to a memory when starting the web front-end project;
intercepting a request through a routing function of expressJS, receiving form information by using formulable, and performing operations including adding, deleting, modifying and searching on the project information in the memory according to the request and the form information;
according to the relevant information of the target server in the project information, remotely logging in the target server by using a node-ssh to obtain the operation authority of the target server;
intercepting a request packet dist.zip through a routing function of expressJS when a new version of a web front-end item is released, and backing up and deleting an item file of an old version in a target server by using node-ssh; secondly, uploading the request packet dist.zip sub-pieces to a project path used for storing the project information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip;
annotating nodes needing to be managed in the Nginx configuration file by regular operation, when the nodes needing to be managed are managed, locating by searching for an anchor point, searching for the position of the nodes needing to be managed, and then performing operations including adding, deleting, modifying and searching on the nodes needing to be managed.
The method can realize lightweight release and management of the web front-end project, stores data in the form of the local JSON file without installing a database, and realizes quick and convenient Nginx installation on the web server and efficient configuration and modification of the installed Nginx server.
In a specific embodiment, the item information includes: account number, password, project path and Nginx profile path of the project server.
In a specific embodiment, the method performs the following steps when restoring the historical version of the web front-end item:
reading a version list of the web front-end project, selecting a historical version needing to be restored from the version list, backing up and filing a project file of a current version, renaming a backup folder of the historical version to a dist folder name of the current version, and recording information of the historical version.
In a specific embodiment, the annotating, by a canonical operation, the node insertion anchor point that needs to be managed in the nginnx configuration file includes:
constructing a matching regular expression for inserting anchor points: (ii)/location [ ^ } ] + }/gm;
and respectively inserting a start position anchor point and an end position anchor point into the start position and the end position of each node needing to be managed, and adding anchor point keywords to all anchor points.
In a specific embodiment, after the management of the node that needs to be managed is finished, the nginnx checksum restart is performed on the target server through node-ssh.
In a specific embodiment, the method further comprises: after remotely logging in the target server by using a node-ssh, obtaining a file stream of a configuration file from an nginx configuration file path in the project information through the node-ssh, storing the file stream in a local temporary file of the target server, transmitting the file stream to a user, and deleting the file stream in the local temporary file.
In a specific embodiment, the fragment resuming algorithm specifically includes the following steps:
determining the total number of fragments according to the file size of the request packet dist.zip and the preset fragment size, and marking each fragment with a corresponding fragment serial number;
determining a chunk starting interval and a chunk ending interval of each chunk according to the file size of the request packet dist.zip, the chunk sequence number and the preset chunk size;
when the number of the requests in the request packet dist.zip is less than or equal to the number of the CPU cores, the requests in the request packet dist.zip are uploaded in parallel;
when the number of the requests in the request packet dist.zip is greater than the number of the CPU cores, grouping the requests in the request packet dist.zip based on an async function and an await function of node.js and by using a chunk starting interval and a chunk ending interval of each fragment, wherein the number of the requests in each group is the number of the CPU cores;
and according to the grouping, the requests in each group are uploaded in parallel, the requests among different groups are uploaded in series, and the uploading progress is stored in the browser cache.
According to a second aspect of the present invention, a computer-readable storage medium is presented, having stored thereon a computer program which, when executed by a computer processor, implements the above-described method.
According to a third aspect of the present invention, a system for web front-end project deployment management is provided, the system comprising:
a data management module: the method comprises the steps that a configuration is used for storing project information in a local JSON file form by utilizing a node.js fs module before a web front-end project is started, and the project information in the local JSON file is read to a memory when the web front-end project is started;
the project management module: configuring a routing function intercepting request for passing through expressJS, receiving form information by using formulable, and performing operations including adding, deleting, modifying and searching on the project information in the memory according to the request and the form information;
ssh login module: the system is configured to remotely log in the target server by using a node-ssh according to the related information of the target server in the project information, and acquire the operation authority of the target server;
and a version management module: the method comprises the steps that a request packet is intercepted through a routing function of expressJS when a new version of a web front-end project is released, and node-ssh is used for backing up and deleting an old version of project file in a target server; secondly, uploading the request packet dist.zip sub-pieces to a project path used for storing the project information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip;
a Nginx management module: the method comprises the steps that nodes needing to be managed in a Nginx configuration file are inserted into anchor points and annotated through regular operation, when the nodes needing to be managed are managed, the anchor points are searched for positioning, the positions of the nodes needing to be managed are searched, and then operations including adding, deleting, modifying and searching are carried out on the nodes needing to be managed.
Storing project information in a local JSON file form, and reading the project information in the local JSON file to a memory when a web front-end project is started; intercepting a request through a routing function of the expressJS, and receiving form information by utilizing formable to operate the project information in the memory; remotely logging in the target server by using a node-ssh to obtain the operation authority of the target server; intercepting a request packet (let. zip) through a routing function of expressJS when a new version of a web front-end item is released, and backing up and deleting an old version of item files in the target server by using node-ssh; uploading the request packet dist.zip sub-pieces to an item path used for storing the item information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip; and annotating the node insertion anchor points needing to be managed in the Nginx configuration file through regular operation, so that the installed Nginx server is managed. The method can realize the lightweight release and management of the web front-end project, store data in the form of the local JSON file without installing a database, and realize the operations of quickly and conveniently installing the Nginx on the web server, efficiently configuring and modifying the installed Nginx server and the like.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of a method of web front end project deployment management in accordance with an embodiment of the present invention;
FIG. 3 is a framework diagram of a system for web front end project deployment management, according to an embodiment of the invention;
FIG. 4 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
FIG. 1 illustrates an exemplary system architecture 100 to which a method for web front-end project deployment management of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications, such as a data processing application, a data visualization application, a web browser application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as a plurality of software or software modules (e.g., software or software modules used to provide distributed services) or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background information processing server that provides support for project information presented on the terminal devices 101, 102, 103. The background information processing server can process the acquired project information and generate a processing result (such as a local JSON file).
It should be noted that the method provided in the embodiment of the present application may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, and the corresponding apparatus is generally disposed in the server 105, or may be disposed in the terminal devices 101, 102, and 103.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 shows a flowchart of a method for web front-end project deployment management according to an embodiment of the present invention. As shown in fig. 2, the method comprises the steps of:
201: and storing the project information in a local JSON file form by utilizing a node.js fs module before starting the web front-end project, and reading the project information in the local JSON file to a memory when starting the web front-end project.
In a specific embodiment, the item information includes: account number, password, project path and Nginx profile path of the project server.
202: intercepting a request through a routing function of expressJS, receiving form information by using formenable, and performing operations including adding, deleting, modifying and searching on the item information in the memory according to the request and the form information.
203: and according to the related information of the target server in the project information, remotely logging in the target server by using a node-ssh to obtain the operation authority of the target server.
In a specific embodiment, the method further comprises: after remotely logging in the target server by using a node-ssh, obtaining a file stream of a configuration file from an nginx configuration file path in the project information through the node-ssh, storing the file stream in a local temporary file of the target server, transmitting the file stream to a user, and deleting the file stream in the local temporary file.
204: intercepting a request packet (let. zip) through a routing function of expressJS when a new version of a web front-end item is released, and backing up and deleting an old version of item files in the target server by using node-ssh; and then, based on a fragment continuous transmission algorithm, uploading the request packet dist.zip fragments to a project path used for storing the project information in the target server, and decompressing the request packet dist.zip.
In a specific embodiment, the fragment resuming algorithm specifically includes the following steps:
determining the total number of fragments according to the file size of the request packet dist.zip and the preset fragment size, and marking each fragment with a corresponding fragment serial number;
determining a chunk starting interval and a chunk ending interval of each chunk according to the file size of the request packet dist.zip, the chunk sequence number and the preset chunk size;
when the number of the requests in the request packet dist.zip is less than or equal to the number of the CPU cores, the requests in the request packet dist.zip are uploaded in parallel;
when the number of the requests in the request packet dist.zip is greater than the number of the CPU cores, grouping the requests in the request packet dist.zip based on the async function and the await function of node.js and by using the chunk starting interval and the chunk ending interval of each fragment, wherein the number of the requests in each group is the number of the CPU cores;
and according to the grouping, the requests in each group are uploaded in parallel, the requests among different groups are uploaded in series, and the uploading progress is stored in the browser cache.
In a specific embodiment, the program code of the fragment continuous transmission algorithm is as follows:
Figure BDA0002880556010000081
205: annotating nodes needing to be managed in the Nginx configuration file by regular operation, when the nodes needing to be managed are managed, locating by searching for an anchor point, searching for the position of the nodes needing to be managed, and then performing operations including adding, deleting, modifying and searching on the nodes needing to be managed.
In a specific embodiment, after the management of the node that needs to be managed is finished, the nginnx checksum restart is performed on the target server through node-ssh.
In a specific embodiment, the annotating, by a canonical operation, the node insertion anchor point that needs to be managed in the nginnx configuration file includes:
constructing a matching regular expression for inserting anchor points: (ii)/location [ ^ } ] + }/gm;
and respectively inserting a start position anchor point and an end position anchor point into the start position and the end position of each node to be managed, and adding anchor point keywords to all anchor points.
In a preferred embodiment, the format for inserting an anchor point into the content of a node may be represented using the following expression:
type # - [ start ] - [ id ] node content # - [ type ] - [ end ] - [ id ].
In a preferred embodiment, finding an anchor point is implemented by the following two position expressions:
position where anchor starts: indexof ("[ $ { type } ] - [ start ] - [ $ { id } ]');
position where anchor point ends: s.indexof ("[ $ { type } ] - [ end ] - [ $ { id } ]').
In a preferred embodiment, the specific algorithmic program code used by the anchor point is as follows:
Figure BDA0002880556010000091
Figure BDA0002880556010000101
in a specific embodiment, the method performs the following steps when restoring the historical version of the web front-end item:
reading a version list of the web front-end project, selecting a historical version needing to be restored from the version list, backing up and filing a project file of a current version, renaming a backup folder of the historical version to a dist folder name of the current version, and recording information of the historical version.
FIG. 3 illustrates a framework diagram of a system for web front-end project deployment management, according to an embodiment of the invention. The system includes a data management module 301, a project management module 302, a ssh login module 303, a version management module 304, and a Nginx management module 305.
In a specific embodiment, the data management module 301 is configured to store the project information in the form of a native JSON file by using a node.js fs module before a web front-end project is started, and read the project information in the native JSON file to a memory when the web front-end project is started;
the project management module 302 is configured to intercept a request through a routing function of expressJS, receive form information by using formenable, and perform operations including adding, deleting, modifying and searching on the project information in the memory according to the request and the form information;
the ssh login module 303 is configured to remotely log in to the target server by using a node-ssh according to the related information of the target server in the project information, and obtain an operation right on the target server;
the version management module 304 is configured to intercept a request packet dist.zip through a routing function of expressJS when a new version of a web front-end item is released, and backup and delete an old version of an item file in the target server by using node-ssh; secondly, uploading the request packet dist.zip sub-pieces to a project path used for storing the project information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip;
the Nginx management module 305 is configured to annotate, through regular operation, an insertion anchor of a node to be managed in a Nginx configuration file, locate, search for a location of the node to be managed by searching for the anchor when managing the node to be managed, and perform operations including adding, deleting, modifying and searching on the node to be managed.
The system can realize the lightweight release and management of the web front-end project, stores data in the form of local JSON files without installing a database, and realizes the operations of quickly and conveniently installing Nginx on the web server, efficiently configuring and modifying the installed Nginx server and the like.
Referring now to FIG. 4, shown is a block diagram of a computer system 400 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable storage medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code 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).
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 code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, 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 that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The units described may also be provided in a processor, and the names of the units do not in some cases constitute a limitation of the unit itself.
Embodiments of the present invention also relate to a computer-readable storage medium having stored thereon a computer program which, when executed by a computer processor, implements the method above. The computer program comprises program code for performing the method illustrated in the flow chart. Note that the computer readable medium of the present application can be a computer readable signal medium or a computer readable medium or any combination of the two.
Storing project information in a local JSON file form, and reading the project information in the local JSON file to a memory when a web front-end project is started; intercepting a request through a routing function of the expressJS, and receiving form information by utilizing formable to operate the project information in the memory; remotely logging in the target server by using a node-ssh to obtain the operation authority of the target server; intercepting a request packet (let. zip) through a routing function of expressJS when a new version of a web front-end item is released, and backing up and deleting an old version of item files in the target server by using node-ssh; uploading the request packet dist.zip sub-pieces to an item path used for storing the item information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip; and annotating the node insertion anchor points needing to be managed in the Nginx configuration file through regular operation, so that the installed Nginx server is managed. The method can realize the lightweight release and management of the web front-end project, store data in the form of the local JSON file without installing a database, and realize the operations of quickly and conveniently installing the Nginx on the web server, efficiently configuring and modifying the installed Nginx server and the like.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (6)

1. A method for web front-end project deployment management, the method comprising:
storing project information in a local JSON file form by using a node.js fs module before starting a web front-end project, and reading the project information in the local JSON file to a memory when the web front-end project is started; wherein the item information includes: an account number, a password, a project path and an Nginx configuration file path of the project server;
intercepting a request through a routing function of expressJS, receiving form information by using formenable, and performing operations including adding, deleting, modifying and searching on the item information in the memory according to the request and the form information;
according to the relevant information of the target server in the project information, remotely logging in the target server by using a node-ssh to obtain the operation authority of the target server;
intercepting a request packet (let. zip) through a routing function of expressJS when a new version of a web front-end item is released, and backing up and deleting an old version of item files in the target server by using node-ssh; secondly, uploading the request packet dist.zip sub-pieces to a project path used for storing the project information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip;
the fragment continuous transmission algorithm specifically comprises the following steps:
zip, determining the total number of fragments according to the file size of the request packet dist.zip and the preset fragment size, and marking each fragment with a corresponding fragment serial number;
determining a chunk starting interval and a chunk ending interval of each chunk according to the file size of the request packet dist.zip, the chunk sequence number and the preset chunk size;
when the number of the requests in the request packet dist.zip is less than or equal to the number of the CPU cores, the requests in the request packet dist.zip are uploaded in parallel;
when the number of the requests in the request packet dist.zip is greater than the number of the CPU cores, grouping the requests in the request packet dist.zip based on an async function and an await function of node.js and by using a chunk starting interval and a chunk ending interval of each fragment, wherein the number of the requests in each group is the number of the CPU cores;
according to the grouping, requests in each group are uploaded in parallel, requests among different groups are uploaded in series, and the uploading progress is stored in a browser cache;
annotating nodes needing to be managed in the Nginx configuration file by inserting anchor points through regular operation, when the nodes needing to be managed are managed, locating by searching the anchor points, searching the positions of the nodes needing to be managed, and then performing operations including adding, deleting, modifying and searching on the nodes needing to be managed;
the specific steps of annotating the node insertion anchor points needing to be managed in the Nginx configuration file through regular operation comprise:
constructing a matching regular expression for inserting anchor points: (iv)/location [ ^ } ] + }/gm;
and respectively inserting a start position anchor point and an end position anchor point into the start position and the end position of each node to be managed, and adding anchor point keywords to all anchor points.
2. The method of claim 1, wherein the method performs the following steps in restoring the historical version of the web front-end item:
reading the version list of the web front-end project, selecting a historical version needing to be restored from the version list, backing up and filing the project file of the current version, renaming the backup folder of the historical version to the dist folder name of the current version, and recording the information of the historical version.
3. The method according to claim 1, wherein when the management of the node requiring management is finished, the target server is subjected to Nginx checksum restart by node-ssh.
4. The method of claim 1, further comprising: after remotely logging in the target server by using a node-ssh, obtaining a file stream of a configuration file from an nginx configuration file path in the project information through the node-ssh, storing the file stream in a local temporary file of the target server, transmitting the file stream to a user, and deleting the file stream in the local temporary file.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a computer processor, carries out the method of any one of claims 1 to 4.
6. A system for web front-end project deployment management, comprising:
a data management module: the method comprises the steps that a configuration is used for storing project information in a local JSON file form by utilizing a node.js fs module before a web front-end project is started, and the project information in the local JSON file is read to a memory when the web front-end project is started; wherein the item information includes: an account number, a password, a project path and an Nginx configuration file path of the project server;
the project management module: configuring a routing function intercepting request for passing through expressJS, receiving form information by using formulable, and performing operations including adding, deleting, modifying and searching on the project information in the memory according to the request and the form information;
ssh login module: the system is configured to remotely log in the target server by using a node-ssh according to the related information of the target server in the project information, and acquire the operation authority of the target server;
and a version management module: the method comprises the steps that a request packet is intercepted through a routing function of expressJS when a new version of a web front-end project is released, and node-ssh is used for backing up and deleting an old version of project file in a target server; secondly, uploading the request packet dist.zip sub-pieces to a project path used for storing the project information in the target server based on a sub-piece continuous transmission algorithm, and decompressing the request packet dist.zip; the method specifically comprises the following steps: determining the total number of fragments according to the file size of the request packet dist.zip and the preset fragment size, and marking each fragment with a corresponding fragment serial number; determining a chunk starting interval and a chunk ending interval of each chunk according to the file size of the request packet dist.zip, the chunk sequence number and the preset chunk size; when the number of the requests in the request packet dist.zip is less than or equal to the number of the CPU cores, the requests in the request packet dist.zip are uploaded in parallel; when the number of the requests in the request packet dist.zip is greater than the number of the CPU cores, grouping the requests in the request packet dist.zip based on the async function and the await function of node.js and by using the chunk starting interval and the chunk ending interval of each fragment, wherein the number of the requests in each group is the number of the CPU cores; according to the grouping, requests in each group are uploaded in parallel, requests among different groups are uploaded in series, and the uploading progress is stored in a browser cache;
a Nginx management module: the method is configured to annotate node insertion anchors which need to be managed in a Nginx configuration file through regular operation, when the nodes which need to be managed are managed, the nodes which need to be managed are located by searching for the anchors, the positions of the nodes which need to be managed are searched, and then the nodes which need to be managed are subjected to operations including adding, deleting, modifying and searching, and the specific steps include: constructing a matching regular expression for inserting anchor points: (ii)/location [ ^ } ] + }/gm; and respectively inserting a start position anchor point and an end position anchor point into the start position and the end position of each node to be managed, and adding anchor point keywords to all anchor points.
CN202011633136.8A 2020-12-31 2020-12-31 Method and system for deployment management of web front-end project Active CN112783514B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011633136.8A CN112783514B (en) 2020-12-31 2020-12-31 Method and system for deployment management of web front-end project

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011633136.8A CN112783514B (en) 2020-12-31 2020-12-31 Method and system for deployment management of web front-end project

Publications (2)

Publication Number Publication Date
CN112783514A CN112783514A (en) 2021-05-11
CN112783514B true CN112783514B (en) 2022-06-14

Family

ID=75754823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011633136.8A Active CN112783514B (en) 2020-12-31 2020-12-31 Method and system for deployment management of web front-end project

Country Status (1)

Country Link
CN (1) CN112783514B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688438A (en) * 2021-08-16 2021-11-23 北京鼎普科技股份有限公司 Web-based file destruction method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830374A (en) * 2018-08-07 2020-02-21 北京京东尚科信息技术有限公司 Method and device for gray level release based on SDK
CN111443921A (en) * 2020-03-27 2020-07-24 中国平安财产保险股份有限公司 Method, system and computer equipment for subpackage deployment of web front-end projects
CN112114939A (en) * 2020-09-04 2020-12-22 青岛海信网络科技股份有限公司 Distributed system deployment equipment and method
CN112115056A (en) * 2020-09-23 2020-12-22 北京达佳互联信息技术有限公司 Project deployment method and device, server and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8589481B2 (en) * 2011-09-14 2013-11-19 Microsoft Corporation Multi tenant access to applications
CN106844137B (en) * 2016-12-08 2020-05-19 腾讯科技(深圳)有限公司 Server monitoring method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830374A (en) * 2018-08-07 2020-02-21 北京京东尚科信息技术有限公司 Method and device for gray level release based on SDK
CN111443921A (en) * 2020-03-27 2020-07-24 中国平安财产保险股份有限公司 Method, system and computer equipment for subpackage deployment of web front-end projects
CN112114939A (en) * 2020-09-04 2020-12-22 青岛海信网络科技股份有限公司 Distributed system deployment equipment and method
CN112115056A (en) * 2020-09-23 2020-12-22 北京达佳互联信息技术有限公司 Project deployment method and device, server and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王子珍 等.满足QoS约束的Web服务部署技术研究.《火力与指挥控制》.2019,第44卷(第2期),全文. *

Also Published As

Publication number Publication date
CN112783514A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
US10891122B2 (en) Rolling upgrade of a distributed application
US10564959B2 (en) Shared software libraries for computing devices
WO2019201039A1 (en) Method and system for updating application and application server
CN113395353B (en) File downloading method and device, storage medium and electronic equipment
US20210373882A1 (en) Method and apparatus for generating difference between old and new versions of data for updating software
WO2023061286A1 (en) Operating system booting method and apparatus, and electronic device
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
WO2019029451A1 (en) Method for publishing mobile applications and electronic apparatus
CN112988583A (en) Method and device for testing syntax compatibility of database
CN112783514B (en) Method and system for deployment management of web front-end project
US8904379B2 (en) Centrally controlled proximity based software installation
US10002135B2 (en) Simplifying the check-in of checked-out files in an ECM system
CN113900720A (en) Operating system starting method and device and electronic equipment
CN111309366B (en) Method, device, medium and electronic equipment for managing registration core
CN113296828A (en) Method, server and system for issuing application
CN110443034B (en) Risk program file identification method and device, computing equipment and medium
CN112748962A (en) Application loading method and device, electronic equipment and computer readable medium
US20120260246A1 (en) Software application installation
CN111125163A (en) Method and apparatus for processing data
CN111625232B (en) Method and device for generating application program installation package, readable medium and electronic equipment
CN114115941A (en) Resource sending method, page rendering method, device, electronic equipment and medium
CN110968334B (en) Application resource updating method, resource package manufacturing method, device, medium and equipment
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN110896391B (en) Message processing method and device
CN113742376A (en) Data synchronization method, first server and data synchronization system

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 361000 unit 102, No. 59, erhaihai Road, software park, Siming District, Xiamen City, Fujian Province

Patentee after: ROPT TECHNOLOGY GROUP Co.,Ltd.

Country or region after: China

Patentee after: ROPT (Xiamen) Big Data Group Co.,Ltd.

Address before: 361000 unit 102, No. 59, erhaihai Road, software park, Siming District, Xiamen City, Fujian Province

Patentee before: ROPT TECHNOLOGY GROUP Co.,Ltd.

Country or region before: China

Patentee before: Lop (Xiamen) system integration Co.,Ltd.

CP03 Change of name, title or address