Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a static resource publishing method according to an embodiment of the present invention, where the method may be executed by a static resource publishing apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a terminal device. As shown in fig. 1, the method includes:
step 101, when a static resource publishing request is received, obtaining a static resource to be published.
In the embodiment of the invention, when the static resource publishing request is received, the static resource to be published is obtained. The static resources can include HTML files, JS files, CSS files, RES files, and picture files or video files, and the embodiment of the present invention does not limit the static resources to be published.
For example, a script command of the deployment may be added to a root directory package of the front-end development project, and when an instruction to run the deployment is received, the receiving of the issue request of the static resource is represented; json file, and when receiving an instruction for running the upload, representing that an issue request of the static resource is received.
Optionally, the obtaining of the static resource to be released includes: and determining the static resource to be issued according to the static resource issuing request. Illustratively, the static resource issuing request carries identification information of the static resource to be issued, and a target static resource corresponding to the identification information can be searched for in all static resources in the front-end development project according to the identification information carried in the static resource issuing request, and the target static resource is used as the static resource to be issued. Illustratively, the static resource publishing request carries a directory identifier of a project development directory where the static resource to be published is located, a target directory is searched from the project development directory according to the directory identifier, wherein the target directory is a directory corresponding to the static resource to be published, and then the static resource to be published is searched based on the target directory.
Optionally, before determining the static resource to be issued according to the static resource issuing request, the method further includes: acquiring a resource release directory; determining the static resource to be issued according to the static resource issuing request, wherein the determining comprises the following steps: determining a target resource publishing directory in the resource publishing directory according to the static resource publishing request; and searching the static resource to be published based on the target resource publishing directory. Illustratively, the resource publishing directory includes location information of each static resource, and the static resource publishing request carries a directory identifier, where the directory identifier may be used to represent a target directory corresponding to the static resource to be published, determine the target resource publishing directory in the resource publishing directory according to the directory identifier, then search for a target static resource corresponding to the static resource publishing request based on the target resource publishing directory, and use the target static resource as the static resource to be published.
And step 102, determining at least one target test server according to the static resource issuing request.
In the embodiment of the invention, the static resource issuing request carries the identification information of at least one test server, and at least one target test server is determined according to the identification information in the static resource issuing request. It can be understood that when the static resource needs to be issued to a plurality of test servers for different performance tests, the identification information of the plurality of test servers may be configured in the static resource issuing request. For example, when a release request of a static resource is received is characterized by running a exploit, identification information of a test server, such as exploit-test 1, may be added after the exploit command, where test1 identifies the identification information of the test server; alternatively, when the issue request of the static resource is received is characterized by running upload, the identification information of the test server, such as upload-test2, may be added after the upload command, where test2 identifies the identification information of the test server.
And 103, releasing the static resource to be released to the target test server.
In the embodiment of the present invention, after at least one target test server is determined in step 102, a connection is established with the target test server, and a static resource to be released is uploaded to the target test server, so as to test the static resource in the target test server, thereby completing the release of the static resource. Illustratively, in the process of publishing the static resource to be published to the target test server, the connection of the SSH (Secure Shell) protocol may be implemented by introducing a scp2 open source NPM (Node Package Manager, which is a Node js Package management and distribution tool) Package module, and then publishing the static resource to be published to the target test server based on the SSH protocol.
Optionally, determining at least one target test server according to the static resource publishing request includes: acquiring a server configuration database; the server configuration database comprises configuration information of each test server; the configuration information comprises an IP address and a port number of the test server, a login user name of the test server and a login password of the test server; searching at least one target configuration information corresponding to the static resource publishing request from the server configuration database to determine at least one target testing server; correspondingly, the step of issuing the static resource to be issued to the target test server includes: and establishing connection with the target test server based on the target configuration information, and issuing the static resource to be issued to the target test server. The advantage that sets up like this lies in, can determine at least target test server simply, fast, can avoid when needs release static resource to a plurality of test server, and the user is manual to be connected with a plurality of test server establishments, and complex operation, the condition that takes time, difficultly just make mistakes easily takes place.
For example, the configuration information of all test servers is contained in the server configuration database, wherein the configuration information of the test servers may include names (or identification information) of the test servers, IP addresses and port numbers of the test servers, login user names of the test servers, and login passwords of the test servers. The static resource issuing request carries identification information or configuration information of at least one test server, and at least one target configuration information corresponding to the static resource issuing request is searched in a server configuration database based on the identification information or the configuration information, so that the target test server to which the static resource to be issued is issued can be determined from all the test servers. And establishing connection with a target test server based on the target configuration information, and issuing the static resources to be issued to the target test server.
According to the static resource issuing method provided by the embodiment of the invention, when a static resource issuing request is received, the static resource to be issued is obtained, at least one target test server is determined according to the static resource issuing request, and finally the static resource to be issued is issued to the target test server. By adopting the technical means, at least one target test server can be automatically determined according to the static resource release request, so that the static resource is released to the test server, the time cost for the front-end developer to manually establish the connection between the front-end development terminal and the test server is reduced, and the release efficiency of the static resource is improved.
In some embodiments, before publishing the static resource to be published to the target test server, the method further includes: packaging the static resource to be issued to generate a static resource package; the step of publishing the static resource to be published to the target test server comprises the following steps: and issuing the static resource packet to the target test server. The method has the advantages that the loss of a certain static resource in the static resource publishing process can be avoided, and the completeness of the published static resource is ensured.
In some embodiments, after publishing the static resource to be published to the target test server, the method further includes: displaying static resource release information, wherein the static resource release information comprises: and the configuration information of the target test server, the directory information corresponding to the static resource to be issued and the issuing time are long. The advantage of this arrangement is that the front-end developer can be made aware of the publishing of static resources.
Fig. 2 is a schematic flowchart of another static resource publishing method according to an embodiment of the present invention, and as shown in fig. 2, the method includes the following steps:
step 201, obtaining a resource release directory.
The resource publishing directory may be used to represent stored location information of each static resource.
Step 202, when the static resource publishing request is received, determining a target resource publishing directory in the resource publishing directory according to the static resource publishing request.
Step 203, searching for the static resource to be published based on the target resource publishing directory.
And 204, packaging the static resource to be issued to generate a static resource package.
Step 205, obtain the server configuration database.
The server configuration database comprises configuration information of each test server; the configuration information comprises an IP address and a port number of the test server, a login user name of the test server and a login password of the test server.
Step 206, at least one target configuration information corresponding to the static resource publishing request is searched from the server configuration database to determine at least one target testing server.
And step 207, establishing connection with the target test server based on the target configuration information, and issuing the static resource packet to the target test server.
And step 208, displaying the static resource release information.
Wherein the static resource publishing information comprises: and the configuration information of the target test server, the directory information corresponding to the static resource to be issued and the issuing time are long.
According to the static resource issuing method provided by the embodiment of the invention, the static resource to be issued and at least one target test server are determined according to the static resource issuing request, then the static resource to be issued is packaged and issued to the target test server, and the static resource issuing information is displayed. Through the technical scheme, the time cost for the front-end developer to manually connect the front-end development terminal with the test server is reduced, the release efficiency of the static resources is improved, the loss of certain static resources in the process of releasing the static resources can be avoided, the integrity of the released static resources is ensured, and meanwhile, the front-end developer can clearly know the release condition of the static resources.
Fig. 3 is a block diagram of a static resource issuing apparatus according to an embodiment of the present invention, where the apparatus may be implemented by software and/or hardware, and is generally integrated in a terminal, and may issue a static resource by executing a static resource issuing method. As shown in fig. 3, the apparatus includes:
a static resource obtaining module 301, configured to obtain a static resource to be released when a static resource release request is received;
a target test server determining module 302, configured to determine at least one target test server according to the static resource issuing request;
a static resource issuing module 303, configured to issue the static resource to be issued to the target test server.
According to the static resource publishing device provided by the embodiment of the invention, when a static resource publishing request is received, the static resource to be published is obtained, at least one target test server is determined according to the static resource publishing request, and finally the static resource to be published is published to the target test server. By adopting the technical means, at least one target test server can be automatically determined according to the static resource release request, so that the static resource is released to the test server, the time cost for the front-end developer to manually establish the connection between the front-end development terminal and the test server is reduced, and the release efficiency of the static resource is improved.
Optionally, the target test server determining module is configured to:
acquiring a server configuration database; the server configuration database comprises configuration information of each test server; the configuration information comprises an IP address and a port number of the test server, a login user name of the test server and a login password of the test server;
searching at least one target configuration information corresponding to the static resource publishing request from the server configuration database to determine at least one target testing server;
correspondingly, the static resource publishing module is configured to:
and establishing connection with the target test server based on the target configuration information, and issuing the static resource to be issued to the target test server.
Optionally, the static resource obtaining module includes:
and the static resource obtaining unit is used for determining the static resource to be issued according to the static resource issuing request.
Optionally, the apparatus further comprises:
the resource publishing directory acquiring module is used for acquiring a resource publishing directory before determining the static resource to be published according to the static resource publishing request;
the static resource obtaining unit is configured to:
determining a target resource publishing directory in the resource publishing directory according to the static resource publishing request;
and searching the static resource to be published based on the target resource publishing directory.
Optionally, the apparatus further comprises:
the static resource packaging module is used for packaging the static resource to be published to generate a static resource package before the static resource to be published is published to the target test server;
the static resource publishing module is configured to:
and issuing the static resource packet to the target test server.
Optionally, the apparatus further comprises:
the release information display module is configured to display static resource release information after the static resource to be released is released to the target test server, where the static resource release information includes: and the configuration information of the target test server, the directory information corresponding to the static resource to be issued and the issuing time are long.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a static resource publishing method, the method including:
when a static resource publishing request is received, obtaining a static resource to be published;
determining at least one target test server according to the static resource issuing request;
and issuing the static resource to be issued to the target test server.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the above-described static resource issuing operation, and may also perform related operations in the static resource issuing method provided in any embodiment of the present invention.
The embodiment of the invention provides a terminal, wherein the terminal can be integrated with the static resource release device provided by the embodiment of the invention. Fig. 4 is a block diagram of a terminal according to an embodiment of the present invention. The terminal 400 may include: a memory 401, a processor 402 and a computer program stored on the memory 401 and executable on the processor, wherein the processor 402 implements the static resource publishing method according to the embodiment of the present invention when executing the computer program.
The terminal provided in the embodiment of the invention obtains the static resource to be issued when receiving the static resource issuing request, determines at least one target test server according to the static resource issuing request, and finally issues the static resource to be issued to the target test server. By adopting the technical means, at least one target test server can be automatically determined according to the static resource release request, so that the static resource is released to the test server, the time cost for the front-end developer to manually establish the connection between the front-end development terminal and the test server is reduced, and the release efficiency of the static resource is improved.
The static resource publishing device, the storage medium and the terminal provided in the above embodiments may execute the static resource publishing method provided in any embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a static resource publishing method provided in any embodiment of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.