CN109819014B - Project deployment method and device, computer equipment and storage medium - Google Patents

Project deployment method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109819014B
CN109819014B CN201811533313.8A CN201811533313A CN109819014B CN 109819014 B CN109819014 B CN 109819014B CN 201811533313 A CN201811533313 A CN 201811533313A CN 109819014 B CN109819014 B CN 109819014B
Authority
CN
China
Prior art keywords
file
address
project
uploading
deployment
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
CN201811533313.8A
Other languages
Chinese (zh)
Other versions
CN109819014A (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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201811533313.8A priority Critical patent/CN109819014B/en
Publication of CN109819014A publication Critical patent/CN109819014A/en
Application granted granted Critical
Publication of CN109819014B publication Critical patent/CN109819014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a method, a device, computer equipment and a storage medium for item deployment, wherein the method comprises the following steps: acquiring an address of a project folder; processing the address of the project folder by intercepting the character string to obtain a superior directory of the address of the project folder; packing the project folder to obtain a first packing file and a file name of the first packing file; setting an uploading address as the upper-level directory of the project folder address and the file name of the first packing file in a pre-constructed file uploading page, and setting the address of a deployment server as a target address; judging whether a second packing file with the same name as the first packing file exists in the deployment server or not; and if the second packaging file does not exist, uploading the first packaging file by using the file uploading page so as to deploy the project in the server. Thereby saving time and improving deployment efficiency.

Description

Project deployment method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for project deployment, a computer device, and a storage medium.
Background
The project deployment refers to uploading a project to a corresponding container of the server for use, access and downloading by a user when the subsequent project is released. In addition, in the prior art, project files are manually packed, uploaded addresses are input, server addresses are input, account information and password information are input, and the energy and time of developers are occupied additionally by inputting the server addresses, the account information and the password information, so that a technical scheme for project deployment capable of solving the problems is needed urgently.
Disclosure of Invention
The main purpose of the present application is to provide a project deployment method, apparatus, computer device, and storage medium, so that project deployment can be implemented by directly adopting a preset upload page without an additional opening tool, and the technical problems of how to save time and improve deployment efficiency when project deployment is performed are solved.
In order to achieve the above object, the present application provides a method for item deployment, including the steps of:
acquiring an address of a project folder;
processing the address of the project folder by intercepting the character string to obtain a superior directory of the address of the project folder;
packing the project folder to obtain a first packed file and a file name of the first packed file;
setting an uploading address as an upper-level directory of the project folder address + the file name of the first packing file and setting an address of a deployment server as a target address in a pre-constructed file uploading page;
judging whether a second packing file with the same name as the first packing file exists in the deployment server or not;
and if the second packaging file does not exist, uploading the first packaging file by using the file uploading page so as to deploy the project in the server.
Further, the step of obtaining the address of the project folder includes:
running the project;
and acquiring the address of the item folder by adopting a getreadPath method.
Further, the method for constructing the file uploading page comprises the following steps:
constructing an HTML page;
generating an uploading address bar and a target address bar through plug-ins in the HTML page, wherein the uploading address bar is configured to be in an editable state, and the target address bar is configured to be in an editable state.
Further, after the step of constructing the HTML page, the method includes:
generating an account field and a password field in the HTML page, the account field being used for inputting an account name for accessing the deployment server, the password field being used for inputting a password corresponding to the account name, wherein the account field is configured to be filled with a preset account name by default, and the password field is configured to be filled with a preset password corresponding to the preset account name by default.
Further, before the step of determining whether the deployment server has the second packaged file with the same name as the first packaged file, the method includes:
sending an access application to the deployment server;
receiving authority verification information sent by the deployment server according to the access application;
and sending the account name and the password to the deployment server.
Further, after the step of determining whether the deployment server has a second packaged file with the same name as the first packaged file, the method includes:
if the second packaged file exists, sending a request for deleting the second packaged file to the deployment server;
and uploading the first packaging file after receiving the information that the second packaging file is deleted and sent by the deployment server.
Further, the step of processing the item folder address by intercepting the character string to obtain a top directory of the item folder address includes:
looking for the last "/" number in the item folder address;
and intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
The application provides a project deployment apparatus, comprising:
an item folder address acquisition unit for acquiring an item folder address;
the upper-level directory acquisition unit is used for processing the project folder address in a character string intercepting manner to acquire an upper-level directory of the project folder address;
the first packing file packing unit is used for packing the project folder to obtain a first packing file and a file name of the first packing file;
the address setting unit is used for setting an uploading address as the upper-level directory of the project folder address and the file name of the first package file in a pre-constructed file uploading page, and setting the address of the deployment server as a target address;
a name judging unit, configured to judge whether a second packaged file having the same name as the first packaged file exists in the deployment server;
and the deployment unit is used for uploading the first packaging file by using the file uploading page if the second packaging file does not exist so as to deploy the project in the server.
The present application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the above methods when the processor executes the computer program.
The present application provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any of the above.
According to the project deployment method, the project deployment device, the computer equipment and the storage medium, the address of a first package file is automatically obtained, a file uploading page is pre-constructed, the upper-level directory of the address of the project folder and the file name of the first package file are set as uploading addresses, the address of a deployment server is used as a target address, and a preset account name and a preset password are configured in the pre-constructed file uploading page in a default mode, so that the time for inputting a command line, the account name and the password is saved, a user does not need to open an additional tool, and the project deployment can be completed by directly accessing a webpage.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a method for item deployment according to an embodiment of the present application;
FIG. 2 is a block diagram illustrating a schematic structure of a project deployment apparatus according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a method for item deployment, including the following steps:
s1, acquiring an address of the project folder;
s2, processing the address of the project folder in a character string intercepting manner to obtain a first-level directory of the address of the project folder;
s3, packaging the project folder to obtain a first packaged file and a file name of the first packaged file;
s4, setting an uploading address as an upper-level directory of the project folder address + the file name of the first package file and setting an address of a deployment server as a target address in a pre-constructed file uploading page;
s5, judging whether a second packing file with the same name as the first packing file exists in the deployment server or not;
and S6, if the second packaged file does not exist, uploading the first packaged file by using the file uploading page so as to deploy the project in the server.
As described in step S1 above, the item folder address is obtained. The items include: webpage engineering, WEB projects, programs, mobile phone APP, software or modules, and the like. The project deployment refers to uploading a project to a corresponding container of the server for a user to use, access and download when the subsequent project is issued. The item folder address refers to the address of the item folder in the local, such as A/B/C, where C is the item folder. And the project file can be accessed and called through the project folder address. The project path acquiring method may use any feasible method, for example, a gettrealpath method to acquire the path of the project.
As described in step S2 above, the item folder address is processed by intercepting the character string, and the upper directory of the item folder address is obtained. Wherein, the processing the project folder address by intercepting the character string specifically comprises: looking for the last "/" number in the item folder address; intercepting the last "/" number and the character strings after the last "/" number (removing the intercepted content by using the item folder address), or intercepting the character strings before the last "/" number (retaining the intercepted content) to obtain the upper-level directory of the item folder address.
As described in step S3 above, the project folder is packaged to obtain the first package file and the file name of the first package file. And packaging the project folder before uploading the server to deploy the project. And uploading the first packing file to a server to realize project deployment operation. Wherein the first packing file is in a war format.
As described in step S4 above, in the pre-constructed file upload page, the upper directory whose upload address is the address of the project folder + the file name of the first package file is set, and the address of the deployment server is set as the target address. The file uploading page is used for transmitting the file from the uploading address to the target address. The file uploading page can be constructed by programming with codes in advance, and can comprise contents of a target address bar, an uploading address bar and the like. The uploading address is composed of a last-level directory of the project folder address and a first packing file name, namely the last-level directory of the project folder address + the file name of the first packing file are composed in the form of the last-level directory of the project folder address/the first packing file. The deployment server refers to a server to which the project of the present application is intended to be deployed.
As described in step S5 above, it is determined whether the deployment server has a second packaged file with the same name as the first packaged file. If the second packaging file exists in the deployment server, the project is indicated to be deployed; the deployment server does not have the second package file, indicating that the project has not been deployed. Without ever being deployed, files may be uploaded directly to deploy the project.
As described in step S6 above, if the second package file does not exist, the first package file is uploaded by using the file upload page, so as to deploy a project in the server. When the deployment server does not exist for the second package file, it indicates that the project has not been deployed. From the foregoing, the file transfer can be implemented to deploy the project by obtaining the address of the project and the address of the deployment server.
In one embodiment, the step S1 of obtaining the address of the item folder includes:
s101, operating the project;
s102, acquiring the address of the item folder by adopting a getTelPath method.
As described above, obtaining the item folder address is achieved. In this embodiment, a gettrealpath method is used to obtain the address of the item folder. Specifically, the code using the getreadpath method includes: string file = "project folder name"; string path = application. Thereby obtaining the project folder address. Wherein the gettrealpath method may return a string containing the real path of a given virtual path. Accordingly, the real address of the project folder can be obtained by running the project and the character string returned by the getreadpath method.
In one embodiment, the method for constructing the file uploading page comprises the following steps:
s401, constructing an HTML page;
s402, generating an uploading address bar and a target address bar in the HTML page through a plug-in, wherein the uploading address bar is configured to be in an editable state, and the target address bar is configured to be in an editable state.
As described above, building a file upload page is achieved. The file uploading page is an HTML page (HyperText Markup Language HyperText Markup Language page), and data transmission is performed through an HTML protocol. The HTML page is provided with an uploading address bar and a target address bar which respectively correspond to the upper-level directory/the first package file of the project folder address and the address of the deployment server, and then projects are deployed to the server. The uploading address bar is configured to be in an editable state, the target address bar is configured to be in an editable state, and manual editing can be performed when the acquired address of the project folder or the address of the deployment server is wrong (or the address is changed), so that the requirement of timely changing and being suitable for different situations is met.
In one embodiment, after the step S401 of building the HTML page, the method includes:
and S403, generating an account column and a password column in the HTML page, wherein the account column is used for inputting an account name for accessing the deployment server, the password column is used for inputting a password corresponding to the account name, the account column is configured to be filled with a preset account name by default, and the password column is configured to be filled with a preset password corresponding to the preset account name by default.
As described above, the addition of an account field and a password field in an HTML page is implemented. Since the deployment server needs a permission certificate to access, and the permission certificate includes an account name and a password, an account field and a password field are generated in the HTML page to provide data required for permission certificate. Wherein the account field is configured to be filled with a preset account name by default; the password field is configured to be filled with a preset password corresponding to the preset account name by default. Therefore, the steps that deployment personnel must manually input account names and passwords are reduced, and the deployment efficiency is improved.
In one embodiment, before the step S5 of determining whether the second package file having the same name as the first package file exists in the deployment server, the method includes:
s41, sending an access application to the deployment server;
s42, receiving authority verification information sent by the deployment server according to the access application;
and S43, sending the account name and the password to the deployment server.
As described above, the authority authentication is realized. Since the deployment server needs the authority authentication to access, and the authority authentication includes the account name and the password, the deployment server needs to verify the account name and the password after receiving the access application. At this time, the account name and the password are provided to the deployment server, and after the verification is passed, the project uploading step can be performed to realize project deployment.
In one embodiment, after the step S5 of determining whether the deployment server has the second package file with the same name as the first package file, the method includes:
s7, if the second packaged file exists, sending a request for deleting the second packaged file to the deployment server;
and uploading the first packaging file after receiving the information that the second packaging file is deleted and sent by the deployment server.
As described above, updating of the packaged file is achieved. If the second package file exists, the fact that project deployment is performed in the deployment server previously is meant. Due to data updates, information updates, function updates, BUG fixes, etc., there is a need to correct deployed projects. At this time, the file upload page may be used to upload a new packaged file, i.e., a first packaged file, to replace an old packaged file, i.e., a second packaged file, so as to update the packaged files.
In an embodiment, the step S2 of processing the item folder address by intercepting the character string to obtain the upper directory of the item folder address includes:
s201, searching the last '/' number in the address of the item folder;
s202, intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
As described above, the acquisition of the upper directory of the address of the item folder is realized. The intercepting method may use any method, for example, a string command, an echo command, etc., to determine the last "/" number in the address of the item folder (i.e., the first "/" number from the right of the address of the item folder), and intercept the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
According to the project deployment method, the address of a first package file is automatically acquired, a file uploading page is pre-constructed, the upper-level directory of the address of the project folder and the file name of the first package file are set as uploading addresses, the address of a deployment server is used as a target address, and a preset account name and a preset password are configured in the pre-constructed file uploading page in a default mode, so that time for inputting a command line, the account name and the password is saved, a tool does not need to be additionally opened, and project deployment can be completed by directly accessing a webpage.
Referring to fig. 2, an embodiment of the present application provides a project deployment apparatus, including:
an item folder address acquisition unit 10 for acquiring an item folder address;
a previous directory acquiring unit 20, configured to process the item folder address by intercepting the character string, and acquire a previous directory of the item folder address;
a first packing file packing unit 30, configured to pack the project folders, and obtain a first packing file and a file name of the first packing file;
an address setting unit 40, configured to set, in a file upload page that is constructed in advance, an upload address as a top-level directory of the project folder address + a filename of the first package file, and set an address of a deployment server as a target address;
a name determining unit 50, configured to determine whether a second packaged file having the same name as the first packaged file exists in the deployment server;
and a deployment unit 60, configured to upload the first package file by using the file upload page if the second package file does not exist, so as to deploy the project in the server.
As described above, the item folder address is acquired. The items include: webpage engineering, WEB projects, programs, mobile phone APP, software or modules, and the like. The project deployment refers to uploading a project to a corresponding container of the server for a user to use, access and download when the subsequent project is issued. The item folder address refers to the address of the item folder in the local, such as A/B/C, where C is the item folder. The project file can be accessed and called through the project folder address. The project path acquiring method may use any feasible method, for example, a gettrealpath method to acquire the path of the project.
As described above, the item folder address is processed by intercepting the character string, and the upper directory of the item folder address is obtained. Wherein, the processing the project folder address by intercepting the character string specifically comprises: looking for the last "/" number in the item folder address; intercepting the last "/" number and the character strings after the last "/" number (removing the intercepted content by using the item folder address), or intercepting the character strings before the last "/" number (retaining the intercepted content) to obtain the upper-level directory of the item folder address.
As described above, the project folder is packaged, and the first package file and the file name of the first package file are obtained. And packaging the project folder before uploading the server to deploy the project. And uploading the first packing file to a server to realize project deployment operation. Wherein the first packing file is in a war format.
As described above, in the file upload page that is constructed in advance, the upload address is set to the upper directory of the project folder address + the file name of the first package file, and the address of the deployment server is set as the destination address. The file uploading page is used for transmitting the file from the uploading address to the target address. The file uploading page can be constructed by programming with codes in advance, and can comprise contents of a target address bar, an uploading address bar and the like. The uploading address is composed of a last-level directory of the project folder address and a first packing file name, namely the last-level directory of the project folder address + the file name of the first packing file are composed in the form of the last-level directory of the project folder address/the first packing file. The deployment server refers to a server to which the project of the present application is intended to be deployed.
As described above, it is determined whether the deployment server has a second packaged file having the same name as the first packaged file. If the second packaging file exists in the deployment server, the project is indicated to be deployed; the deployment server does not have the second package file, indicating that the project has not been deployed. Files may be uploaded directly to deploy the project without ever being deployed.
As described above, if the second package file does not exist, the first package file is uploaded using the file upload page to deploy a project in the server. When the deployment server does not exist the second package file, indicating that the project has not been deployed. From the foregoing, the file transfer can be implemented to deploy the project by obtaining the address of the project and the address of the deployment server.
In one embodiment, the item folder address obtaining unit 10 includes:
a project operation subunit, configured to operate the project;
and the item folder address subunit is used for acquiring the item folder address by adopting a getreadPath method.
As described above, obtaining the item folder address is achieved. In this embodiment, a gettrealpath method is used to obtain the address of the item folder. Specifically, the code using the getreadpath method includes: string file = "project folder name"; string path = application. Thereby obtaining the project folder address. Wherein the gettrealpath method may return a string containing the real path of a given virtual path. Accordingly, the real address of the project folder can be obtained by running the project and the character string returned by the getreadpath method.
In one embodiment, the apparatus includes a building unit of a file upload page, the building unit of the file upload page including:
the HTML page constructing subunit is used for constructing an HTML page;
the address bar generating subunit is configured to generate an upload address bar and a target address bar through a plug-in the HTML page, where the upload address bar is configured in an editable state, and the target address bar is configured in an editable state.
As described above, building a file upload page is realized. The file uploading page is an HTML page and carries out data transmission through an HTML protocol. The HTML page is provided with an uploading address bar and a target address bar which respectively correspond to the upper-level directory/the first package file of the project folder address and the address of the deployment server, and then projects are deployed to the server. The uploading address bar is configured to be in an editable state, the target address bar is configured to be in an editable state, and manual editing can be performed when the acquired address of the project folder or the address of the deployment server is wrong (or the address is changed), so that the requirements for timely changing and adapting to different situations are met.
In one embodiment, the building unit of the file upload page includes:
an account column and password column generation subunit, configured to generate an account column and a password column in the HTML page, where the account column is used to input an account name for accessing the deployment server, and the password column is used to input a password corresponding to the account name, where the account column is configured to be filled with a preset account name by default, and the password column is configured to be filled with a preset password corresponding to the preset account name by default.
As described above, the addition of an account field and a password field in an HTML page is implemented. Since the deployment server needs a permission certificate to access, and the permission certificate includes an account name and a password, an account field and a password field are generated in the HTML page to provide data required for permission certificate. Wherein the account field is configured to be filled with a preset account name by default; the password field is configured to be filled with a preset password corresponding to the preset account name by default. Therefore, the steps that the deployment personnel must manually input the account name and the password are reduced, and the deployment efficiency is improved.
In one embodiment, the apparatus comprises:
an access application sending unit, configured to send an access application to the deployment server;
the permission verification information receiving unit is used for receiving permission verification information sent by the deployment server according to the access application;
and the account name and password sending unit is used for sending the account name and the password to the deployment server.
As described above, the authority authentication is realized. Since the deployment server needs the authority authentication to access, and the authority authentication includes the account name and the password, the deployment server needs to verify the account name and the password after receiving the access application. At this time, the account name and the password are provided to the deployment server, and after the account name and the password pass the verification, a project uploading step can be performed to implement project deployment.
In one embodiment, the apparatus comprises:
the covering unit is used for sending a request for deleting the second packaged file to the deployment server if the second packaged file exists;
and uploading the first packaging file after receiving the information that the second packaging file is deleted and sent by the deployment server.
As described above, updating of the packaged file is achieved. If the second package file exists, the fact that project deployment is performed in the deployment server previously is meant. Due to data updates, information updates, function updates, BUG fixes, etc., it is necessary to correct the deployed project. At this time, the file upload page may be used to upload a new packaged file, i.e., a first packaged file, to replace an old packaged file, i.e., a second packaged file, so as to update the packaged files.
In one embodiment, the upper level directory obtaining unit 20 includes:
a find subunit, configured to find a last "/" number in the item folder address;
and the intercepting subunit is used for intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
As described above, the acquisition of the upper directory of the address of the item folder is realized. The intercepting method may use any method, for example, by using string command, echo command, etc., first determining the last "/" number in the address of the item folder (i.e., the first "/" number from the right of the address of the item folder), and intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
The project deployment device comprises an address acquisition unit, a pre-constructed file uploading page, a first-level directory and a file name acquisition unit, wherein the address acquisition unit is used for acquiring the address of a first package file, the pre-constructed file uploading page is used for acquiring the address of a project folder, the file name of the first package file is set as an uploading address, the address of a deployment server is used as a target address, the pre-constructed file uploading page is configured with a preset account name and a preset password in a default mode, and therefore time for inputting command lines, the account name and the password is saved, no extra tool is needed to be opened, and project deployment can be completed by directly accessing a webpage.
Referring to fig. 3, an embodiment of the present invention further provides a computer device, where the computer device may be a server, and an internal structure of the computer device may be as shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data used by the item deployment method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of project deployment.
The processor executes the item deployment method, and comprises the following steps: acquiring an address of a project folder; processing the address of the project folder by intercepting the character string to obtain a superior directory of the address of the project folder; packing the project folder to obtain a first packed file and a file name of the first packed file; setting an uploading address as the upper-level directory of the project folder address and the file name of the first packing file in a pre-constructed file uploading page, and setting the address of a deployment server as a target address; judging whether a second packing file with the same name as the first packing file exists in the deployment server or not; and if the second packaging file does not exist, uploading the first packaging file by using the file uploading page so as to deploy the project in the server.
In one embodiment, the step of obtaining the address of the item folder includes: running the project; and acquiring the address of the project folder by adopting a getTrealPath method.
In one embodiment, the method for constructing the file upload page includes: constructing an HTML page; generating an uploading address bar and a target address bar through plug-ins in the HTML page, wherein the uploading address bar is configured to be in an editable state, and the target address bar is configured to be in an editable state.
In one embodiment, the step of building an HTML page is followed by: generating an account field and a password field in the HTML page, the account field being used for inputting an account name for accessing the deployment server, the password field being used for inputting a password corresponding to the account name, wherein the account field is configured to be filled with a preset account name by default, and the password field is configured to be filled with a preset password corresponding to the preset account name by default.
In one embodiment, before the step of determining whether the deployment server has the second package file with the same name as the first package file, the method includes: sending an access application to the deployment server; receiving authority verification information sent by the deployment server according to the access application; and sending the account name and the password to the deployment server.
In one embodiment, after the step of determining whether the deployment server has the second package file with the same name as the first package file, the method includes: if the second packaged file exists, sending a request for deleting the second packaged file to the deployment server; and after the information that the second packaging file is deleted and sent by the deployment server is received, uploading the first packaging file.
In one embodiment, the step of processing the item folder address by intercepting the character string to obtain a higher-level directory of the item folder address includes: looking for the last "/" number in the item folder address; and intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
It will be appreciated by those skilled in the art that the architecture shown in the figures is merely a block diagram of some of the structures associated with the embodiments of the present application and is not intended to limit the scope of the present application.
The computer equipment of the application uploads the page through the address of automatically acquiring the first packing file, pre-constructed file, will the last level directory + of the project folder address the file name of the first packing file is set as the uploading address, the address of the deployment server is taken as the target address, and the pre-constructed file uploading page is configured with the preset account name and the preset password by default, so that the time of inputting command line, account name and password is saved, no extra tool is needed to be opened, and project deployment can be completed by directly accessing the webpage.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a method for item deployment, including the steps of: acquiring an address of a project folder; processing the project folder address in a character string intercepting mode to obtain a superior directory of the project folder address; packing the project folder to obtain a first packing file and a file name of the first packing file; setting an uploading address as the upper-level directory of the project folder address and the file name of the first packing file in a pre-constructed file uploading page, and setting the address of a deployment server as a target address; judging whether a second packing file with the same name as the first packing file exists in the deployment server or not; and if the second packaging file does not exist, uploading the first packaging file by using the file uploading page so as to deploy the project in the server.
In one embodiment, the step of obtaining the address of the item folder includes: running the project; and acquiring the address of the project folder by adopting a getTrealPath method.
In one embodiment, the method for constructing the file upload page includes: constructing an HTML page; generating an uploading address bar and a target address bar through plug-ins in the HTML page, wherein the uploading address bar is configured to be in an editable state, and the target address bar is configured to be in an editable state.
In one embodiment, the step of building an HTML page is followed by: generating an account field and a password field in the HTML page, the account field being used for inputting an account name for accessing the deployment server, the password field being used for inputting a password corresponding to the account name, wherein the account field is configured to be filled with a preset account name by default, and the password field is configured to be filled with a preset password corresponding to the preset account name by default.
In one embodiment, before the step of determining whether the deployment server has the second package file with the same name as the first package file, the method includes: sending an access application to the deployment server; receiving authority verification information sent by the deployment server according to the access application; and sending the account name and the password to the deployment server.
In one embodiment, after the step of determining whether the second package file with the same name as the first package file exists in the deployment server, the method includes: if the second packaged file exists, sending a request for deleting the second packaged file to the deployment server; and uploading the first packaging file after receiving the information that the second packaging file is deleted and sent by the deployment server.
In one embodiment, the step of processing the item folder address by intercepting the character string to obtain a higher-level directory of the item folder address includes: looking for the last "/" number in the item folder address; and intercepting the character string before the last "/" number to obtain a superior directory of the item folder address.
The computer-readable storage medium comprises an address of a first packing file is automatically acquired, a file uploading page is pre-constructed, the upper-level directory + of a project folder address is set as the uploading address, the address of a deployment server is used as a target address, the pre-constructed file uploading page is configured with a preset account name and a preset password in a default mode, and therefore time for inputting a command line, the account name and the password is saved, no extra tool is required to be opened, and project deployment can be completed by directly accessing a webpage.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A method of project deployment, comprising:
acquiring an address of a project folder;
processing the project folder address in a character string intercepting mode to obtain a superior directory of the project folder address;
packing the project folder to obtain a first packing file and a file name of the first packing file;
setting an uploading address as the upper-level directory of the project folder address and the file name of the first packing file in a pre-constructed file uploading page, and setting the address of a deployment server as a target address;
judging whether a second packing file with the same name as the first packing file exists in the deployment server or not;
and if the second packaging file does not exist, uploading the first packaging file by using the file uploading page so as to deploy the project in the server.
2. The method of claim 1, wherein said step of obtaining a project folder address comprises:
running the project;
and acquiring the address of the item folder by adopting a getreadPath method.
3. The method according to claim 1, wherein the method for constructing the document upload page includes:
constructing an HTML page;
generating an uploading address bar and a target address bar through a plug-in the HTML page, wherein the uploading address bar is configured to be in an editable state, and the target address bar is configured to be in an editable state.
4. The method of claim 3, wherein the step of building an HTML page is followed by:
generating an account field and a password field in the HTML page, the account field being used for inputting an account name for accessing the deployment server, the password field being used for inputting a password corresponding to the account name, wherein the account field is configured to be filled with a preset account name by default, and the password field is configured to be filled with a preset password corresponding to the preset account name by default.
5. The item deployment method according to claim 4, wherein the step of determining whether or not a second packaged file having the same name as the first packaged file exists in the deployment server is preceded by:
sending an access application to the deployment server;
receiving authority verification information sent by the deployment server according to the access application;
and sending the account name and the password to the deployment server.
6. The item deployment method according to claim 1, wherein the step of determining whether the deployment server has a second packaged file having the same name as the first packaged file, is followed by:
if the second packaged file exists, sending a request for deleting the second packaged file to the deployment server;
and uploading the first packaging file after receiving the information that the second packaging file is deleted and sent by the deployment server.
7. The method according to claim 1, wherein the step of processing the project folder address by intercepting the character string to obtain a higher-level directory of the project folder address includes:
looking for the last "/" number in the item folder address;
and intercepting the character string before the last "/" number to obtain the upper-level directory of the address of the item folder.
8. A project deployment apparatus, comprising:
an item folder address acquisition unit for acquiring an item folder address;
the upper-level directory acquisition unit is used for processing the project folder address in a character string intercepting manner to acquire an upper-level directory of the project folder address;
the first packing file packing unit is used for packing the project folder to obtain a first packing file and a file name of the first packing file;
the address setting unit is used for setting an uploading address as the upper-level directory of the project folder address and the file name of the first package file in a pre-constructed file uploading page, and setting the address of the deployment server as a target address;
a name judging unit, configured to judge whether a second packaged file having the same name as the first packaged file exists in the deployment server;
and the deployment unit is used for uploading the first packaging file by using the file uploading page if the second packaging file does not exist so as to deploy the project in the server.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201811533313.8A 2018-12-14 2018-12-14 Project deployment method and device, computer equipment and storage medium Active CN109819014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811533313.8A CN109819014B (en) 2018-12-14 2018-12-14 Project deployment method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811533313.8A CN109819014B (en) 2018-12-14 2018-12-14 Project deployment method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109819014A CN109819014A (en) 2019-05-28
CN109819014B true CN109819014B (en) 2022-10-25

Family

ID=66602080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811533313.8A Active CN109819014B (en) 2018-12-14 2018-12-14 Project deployment method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109819014B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110427343A (en) * 2019-06-27 2019-11-08 苏州浪潮智能科技有限公司 A kind of method of deployment file, computer equipment and readable storage medium storing program for executing
CN112153127A (en) * 2020-09-11 2020-12-29 苏州浪潮智能科技有限公司 File deployment method, device, equipment and storage medium
CN113590172A (en) * 2021-07-28 2021-11-02 北京百度网讯科技有限公司 Code file publishing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106936904A (en) * 2017-03-07 2017-07-07 济南浪潮高新科技投资发展有限公司 A kind of picture upload method and device
CN107026812A (en) * 2015-06-25 2017-08-08 中兴通讯股份有限公司 A kind of page processing method and multimedia terminal
CN107528865A (en) * 2016-06-21 2017-12-29 平安科技(深圳)有限公司 The method for down loading and system of file
CN108563754A (en) * 2018-04-16 2018-09-21 Oppo广东移动通信有限公司 Document handling method, device, mobile terminal and computer readable storage medium
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066948A1 (en) * 2002-08-06 2011-03-17 Tsao Sheng Ted Method and apparatus for accessing and managing a multi-layered virtual server by deploying web folder tree

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107026812A (en) * 2015-06-25 2017-08-08 中兴通讯股份有限公司 A kind of page processing method and multimedia terminal
CN107528865A (en) * 2016-06-21 2017-12-29 平安科技(深圳)有限公司 The method for down loading and system of file
CN106936904A (en) * 2017-03-07 2017-07-07 济南浪潮高新科技投资发展有限公司 A kind of picture upload method and device
CN108563754A (en) * 2018-04-16 2018-09-21 Oppo广东移动通信有限公司 Document handling method, device, mobile terminal and computer readable storage medium
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
VC++6.0 中遍历目录树查找文件的应用;廖远来等;《宁波职业技术学院学报 》;20080430;第69-71页 *

Also Published As

Publication number Publication date
CN109819014A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN108446116B (en) Application program page generation method and device, computer equipment and storage medium
CN109819014B (en) Project deployment method and device, computer equipment and storage medium
US10212563B2 (en) Updating web resources
CN108287839B (en) Page loading method and equipment
CN107870787B (en) Application program plug-in loading method and system
CN103942067B (en) Smart machine clears up the method and device of software installation APMB package automatically
CN103826215A (en) Method and apparatus for carrying out root authority management at terminal equipment
CN109412896B (en) Method and device for testing uploading function, computer equipment and storage medium
CN110674625A (en) Code generation method and device, computer equipment and storage medium
CN107301137A (en) RSET interface realizing methods and device and electronic equipment and computer-readable recording medium
CN109635217A (en) H5 page loading method, device, computer equipment and the storage medium of APP
CN111881473A (en) Privacy file protection method and device, computer equipment and readable storage medium
CN107391182B (en) Generation method, device, server and storage medium of theme installation package
CN112507729A (en) Method and device for translating text in page, computer equipment and storage medium
CN115562690A (en) Algorithm service processing method, device and medium based on Docker container
CN111984520A (en) Buried point testing method, computer device and computer-readable storage medium
JP6560824B2 (en) How to manage packages in secure elements
CN105912357B (en) Starting method and device of hybrid application
CN109614188B (en) Page online help method and device, computer equipment and storage medium
US20190098045A1 (en) Browser injection prevention method, browser client and apparatus
CN113486267B (en) Method, device, equipment and storage medium for analyzing application entry page
CN113472915B (en) Domain name resolution method, device, equipment and storage medium
CN113282300A (en) Volume optimization method, device, equipment and storage medium for application installation package
CN113254832A (en) Webpage menu configuration method and device, computer equipment and storage medium
CN112632946A (en) Method, apparatus, computer device and storage medium for automatic table building

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