[go: up one dir, main page]

CN114741089B - Method and device for remotely deploying product folders using recursive functions - Google Patents

Method and device for remotely deploying product folders using recursive functions Download PDF

Info

Publication number
CN114741089B
CN114741089B CN202210254867.4A CN202210254867A CN114741089B CN 114741089 B CN114741089 B CN 114741089B CN 202210254867 A CN202210254867 A CN 202210254867A CN 114741089 B CN114741089 B CN 114741089B
Authority
CN
China
Prior art keywords
folder
deployment
file
parameter
name
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
CN202210254867.4A
Other languages
Chinese (zh)
Other versions
CN114741089A (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.)
Seczone Technology Co Ltd
Original Assignee
Seczone Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seczone Technology Co Ltd filed Critical Seczone Technology Co Ltd
Priority to CN202210254867.4A priority Critical patent/CN114741089B/en
Publication of CN114741089A publication Critical patent/CN114741089A/en
Application granted granted Critical
Publication of CN114741089B publication Critical patent/CN114741089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开一种利用递归函数远程部署制品文件夹的方法及装置,其中方法包括:将本地的制品文件夹的全名称和远程部署服务器的部署目录分别作为递归函数的第一个参数和第二个参数,调用递归函数;从第一个参数获取制品文件夹的名称并拼接至第二个参数后面以形成部署文件夹的全名称,利用该全名称远程创建部署文件夹;遍历制品文件夹下的文件和子文件夹,将获取到的文件的文件名拼接至部署文件夹的全名称的后面形成文件部署全名称,以及传输该文件为远程部署服务器中以文件部署全名称定义的文件,如果存在子文件夹,获取该子文件夹的名称并拼接在第一个参数后面作为新的第一个参数,将部署文件夹的全名称作为新的第二个参数,调用递归函数。

The present application discloses a method and device for remotely deploying a product folder using a recursive function, wherein the method comprises: taking the full name of a local product folder and the deployment directory of a remote deployment server as the first parameter and the second parameter of the recursive function respectively, and calling the recursive function; obtaining the name of the product folder from the first parameter and concatenating it to the second parameter to form the full name of the deployment folder, and using the full name to remotely create a deployment folder; traversing the files and subfolders under the product folder, concatenating the file name of the obtained file to the full name of the deployment folder to form a file deployment full name, and transmitting the file as a file defined by the file deployment full name in the remote deployment server, and if a subfolder exists, obtaining the name of the subfolder and concatenating it to the first parameter as a new first parameter, taking the full name of the deployment folder as a new second parameter, and calling the recursive function.

Description

Method and device for remotely deploying product folders by using recursive function
Technical Field
The application relates to the technical field of deploying product folders, in particular to a method and a device for remotely deploying product folders by using a recursive function.
Background
When a folder type product is deployed in the conventional devops pipeline, the folder is usually compressed before deployment to generate a single binary file, then the binary file is uploaded to a deployment server, a remote command is called to decompress the binary file, and then the original binary file is deleted. However, when the decompression command is executed on the deployment server, the deployment server may not have available the decompression command, which may cause the folder type artifact to fail deployment, reducing deployment efficiency. Common compression formats are zip, rar, jar,7z, cab, ace, gz, bz2, etc., and different compression formats require different decompression tools for decompression.
Accordingly, there is a need to provide a method of deploying an artifact folder that does not require decompression operations.
Disclosure of Invention
The application aims to provide a method, a device, electronic equipment and a computer readable storage medium for remotely deploying a product folder by using a recursive function, which do not need decompression operation and are beneficial to avoiding deployment failure.
To achieve the above object, the present application provides a method for remotely deploying an artifact folder using a recursive function, comprising:
the method comprises the steps of taking the full name of a local product folder as an initial first parameter of a recursive function, taking a deployment catalog of a remote deployment server as an initial second parameter of the recursive function, and calling the recursive function;
acquiring the names of the product folders from the initial first parameter;
Splicing names of the artifact folders behind the initial second parameter to form a full name of a deployment folder, and remotely creating the deployment folder on the remote deployment server by using the full name;
traversing the files and subfolders under the product folder, if the files exist, acquiring the file names corresponding to the files and splicing the file names to the back of the full names of the deployment folders to form file deployment full names, transmitting the files to the remote deployment server and becoming files defined by the file deployment full names in the remote deployment server, if the subfolders exist, acquiring the names of the subfolders and splicing the subfolders behind the initial first parameters to serve as new first parameters, and calling the full names of the deployment folders to serve as new second parameters.
Optionally, the method further comprises taking a path separator as an identifier, and taking the content behind the last path separator in the initial first parameter as the name of the product folder.
Optionally, the "transfer the file to the remote deployment server and become a file defined in the remote deployment server under the full name of the file deployment" is performed in a scp command.
Optionally, the method is a devops pipeline method of deploying the artifact folder.
To achieve the above object, the present application further provides an apparatus for remotely deploying an artifact folder using a recursive function, comprising:
the system comprises a calling module, a remote deployment server and a storage module, wherein the calling module is used for calling a local product folder with the full name of the initial first parameter of a recursive function and a deployment catalog of the remote deployment server as the initial second parameter of the recursive function;
the acquisition module is used for acquiring the names of the product folders from the initial first parameter;
the splicing and creating module is used for splicing the names of the product folders behind the initial second parameters to form the full names of the deployment folders, and remotely creating the deployment folders on the remote deployment server by utilizing the full names;
The traversing processing module is used for traversing the files and subfolders under the product folder, acquiring the file names corresponding to the files and splicing the file names to the back of the full names of the deployment folders to form file deployment full names, transmitting the files to the remote deployment server and becoming files defined by the file deployment full names in the remote deployment server, acquiring the names of the subfolders and splicing the names of the subfolders to serve as new first parameters after the initial first parameters if the subfolders exist, and calling the full names of the deployment folders to serve as new second parameters.
Optionally, the method further comprises taking a path separator as an identifier, and taking the content behind the last path separator in the initial first parameter as the name of the product folder.
Optionally, the "transfer the file to the remote deployment server and become a file defined in the remote deployment server under the full name of the file deployment" is performed in a scp command.
Optionally, the device is a devops pipeline deployment product folder device.
To achieve the above object, the present application also provides an electronic device, including:
A processor;
a memory having stored therein executable instructions of the processor;
Wherein the processor is configured to perform the method of remotely deploying an artifact folder using a recursive function as described above via execution of the executable instructions.
To achieve the above object, the present application also provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements a method for remotely deploying an artifact folder using a recursive function as described above.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the method of remotely deploying an artifact folder using a recursive function as described above.
The application takes the full name of a local product folder and the deployment catalog of a remote deployment server as a first parameter and a second parameter of a recursion function respectively, thereby calling the recursion function to execute the following operations of acquiring the name of the product folder from the first parameter and splicing the name of the product folder behind the second parameter to form the full name of the deployment folder and remotely creating the deployment folder based on the full name, then traversing the files and subfolders under the product folder, splicing the file names of the existing files to the file deployment full name behind the deployment folder and transmitting the files to be files defined by the file deployment full name in the remote deployment server, splicing the names of the existing subfolders behind the first parameter to be used as new first parameter, calling the recursion function continuously to carry out remote deployment on the subfolders. And by analogy, if the folder still exists under the next-level directory, continuing to call the recursive function to process until the deployment of the folder under the lowest-level directory is completed, and at the moment, successfully deploying the folder with the same directory structure as the local product folder under the deployment directory of the remote deployment server. The application provides a brand-new method for deploying folders, which does not need decompression operation, is favorable for avoiding the occurrence of deployment failure and improves the success rate of deployment.
Drawings
FIG. 1 is a schematic diagram of an initial first parameter in an embodiment of the present application.
FIG. 2 is a schematic diagram of an initial second parameter in an embodiment of the present application.
FIG. 3 is a schematic diagram of acquiring names of product folders in an embodiment of the application.
FIG. 4 is a schematic diagram of the full names spliced to form a deployment folder in an embodiment of the present application.
FIG. 5 is a schematic diagram of traversing files and subfolders in an artifact folder in an embodiment of the present application.
Fig. 6 is a schematic diagram of a file deployment full name formed by stitching in an embodiment of the present application.
Fig. 7 is a schematic diagram of a new first parameter in an embodiment of the application.
Fig. 8 is a schematic diagram of a new second parameter in an embodiment of the application.
FIG. 9 is a diagram of acquiring names of subfolders in an embodiment of the present application.
FIG. 10 is a schematic diagram of a full name of a sub-folder that is spliced to form a deployment in an embodiment of the present application.
FIG. 11 is a schematic diagram of traversing files and grandchild folders in a child folder in an embodiment of the application.
FIG. 12 is a schematic diagram of a sub-file deployment full name formed by stitching in an embodiment of the present application.
FIG. 13 is a schematic diagram of another first parameter in an embodiment of the application.
FIG. 14 is a schematic diagram of another second parameter in an embodiment of the application.
FIG. 15 is a flow chart of a method for remotely deploying artifact folders using a recursive function according to an embodiment of the application.
FIG. 16 is a schematic block diagram of an apparatus for remotely deploying an artifact folder using a recursive function in accordance with an embodiment of the present application.
Fig. 17 is a schematic block diagram of an electronic device according to an embodiment of the application.
Detailed Description
In order to describe the technical content, the constructional features, the achieved objects and effects of the present application in detail, the following description is made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1 to 15, an embodiment of the present application discloses a method for remotely deploying an artifact folder by using a recursive function, which includes:
101. The full name of the local product folder is called as the initial first parameter of the recursive function, and the deployment catalog of the remote deployment server is called as the initial second parameter of the recursive function.
In the present application, the "full name of the product folder" refers to the path of the product folder plus the name of the product folder. For ease of understanding, please refer to FIG. 1, which gives one example of the full name of the artifact folder "/a/b/c", where "c" refers to the name of the artifact folder, "/a/b" may be considered as the path of the artifact folder, and "/" refers to the path delimiter.
"Deployment directory of remote deployment server" refers to a deployment path for deploying folders on the remote deployment server that have the same directory structure as the artifact folders. For ease of understanding, please refer to FIG. 2, which presents one example of a deployment directory for a remote deployment server, in which the deployment directory or deployment path is "/1/2/3".
102. The name of the artifact folder is obtained from the initial first parameter.
After the recursive function is invoked, the deployment job may be executed by the recursive function. In order to facilitate the creation of folders on the remote deployment server that have the same directory structure as the artifact folder, the recursive function will obtain the name of the artifact folder from the initial first parameter (the full name of the artifact folder). For ease of understanding, please refer to FIGS. 1 and 3 in conjunction, wherein FIG. 3 shows the name "c" of the artifact folder obtained from the initial first parameter "/a/b/c" in FIG. 1.
Specifically, in order to facilitate the acquisition of the name of the product folder from the initial first parameter, the path separator is taken as an identifier, and the content behind the last path separator in the initial first parameter is taken as the name of the product folder.
Specifically, when the name of the artifact folder is acquired from the initial first parameter, a path separator separating the name of the artifact folder from its path may be acquired together. In the example of fig. 3, the acquisition is "/c".
103. The names of the artifact folders are spliced behind the initial second parameter to form the full name of the deployment folder, and the deployment folder is created remotely on the remote deployment server using the full name.
After the name of the product folder is obtained from the initial first parameter, the recursive function can splice the name of the product folder to the back of the initial second parameter, so that the full name of the deployment folder is formed. After the full name of the deployment folder is obtained, the recursive function can remotely create the deployment folder by using the full name, namely, create the deployment folder with the full name.
In the present application, the term "deployment folder" refers to a folder corresponding to a local product folder that needs to be deployed at a remote deployment server. The full name of the deployment folder is the path of the deployment folder plus the name of the deployment folder, wherein the path of the deployment folder is the deployment directory (initial second parameter) of the remote deployment server, and the name of the deployment folder is the same as the name of the product folder, so that the full name of the deployment folder can be obtained by splicing the name of the product folder behind the initial second parameter.
For ease of understanding, please refer to fig. 2,3 and 4, in a specific example, the name "c" of the manufactured folder is spliced to the initial second parameter "/1/2/3" to obtain the full name "/1/2/3/c" of the deployed folder, and then the deployed folder with the full name "/1/2/3/c" can be created on the remote deployment server.
104. Traversing the files and subfolders under the product folder, if the files exist, acquiring the file names corresponding to the files and splicing the file names to the back of the full names of the deployment folders to form the file deployment full names, transmitting the files to a remote deployment server and becoming files defined by the file deployment full names in the remote deployment server, if the subfolders exist, acquiring the names of the subfolders and splicing the names of the subfolders behind the initial first parameters to serve as new first parameters, taking the full names of the deployment folders as new second parameters, and calling a recursion function.
After the creation of the deployment folder is completed, the recursive function can execute the traversing operation of the product folder, the file deployment full name is formed by splicing the file names and the full names of the deployment folders for the existing files, then the files can be transmitted to the deployment folder of the remote deployment server based on the file deployment full name to become files defined by the file deployment full name, and for the existing subfolders, the names of the subfolders are spliced behind the initial first parameters to serve as new first parameters, the full names of the deployment folders are served as new second parameters, and then the recursive function can be called again to conduct remote deployment on the subfolders.
For ease of understanding, please refer to fig. 5-14 in this example, all files and all subfolders under the full name "/a/b/c" are traversed, for any file present, the file name "test.txt" corresponding to that file is taken and spliced to the full name "/1/2/3/c" of the deployment folder to form the file deployment full name "/1/2/3/c test.txt", and then the file "test.txt" is uploaded under the deployment folder under the full name "/1/2/3/c" based on the file deployment full name "/1/2/3/c test.txt".
For any existing subfolder, the name "d" of the subfolder is spliced behind the initial first parameter "/a/b/c" as a new first parameter "/a/b/c/d", and the full name "/1/2/3/c" of the deployed folder is used as a new second parameter, and then the recursive function can be called again based on the new first parameter "/a/b/c/d" and the new second parameter "/1/2/3/c". The recursive function can be deployed remotely for the subfolder, i.e., perform the same operations as for the artifact folder:
Referring specifically to fig. 5 to 14, first, the name "d" of the subfolder is obtained from the new first parameter/a/b/c/d ". Then, the name "d" of the subfolder is spliced with the new second parameter "/1/2/3/c" to obtain the full name "/1/2/3/c/d" of the deployment subfolder, and the deployment subfolder with the full name "/1/2/3/c/d" is created on the remote deployment server. Then, traversing the file and grandchild folder under the subfolder, if the file exists, acquiring the file name of the grandchild folder, "test2.Txt", splicing to the back of the full name "/1/2/3/c/d" deploying the subfolder, forming the subfolder deployment full name "/1/2/3/c/d test2.Txt", transmitting the file test2.Txt to the remote deployment server and becoming the file defined by the subfolder deployment full name "/1/2/3/c/d test2.Txt", if the file exists, acquiring the name "e" of the grandchild folder, splicing to the back of the first parameter "/a/b/c/d", using the full name/1/2/3/c/d of the deployment subfolder as the second parameter, continuing to call a recursive function, and completing the deployment of the directory in the remote deployment server at the same level as the lowest level of the directory, if the file is successfully deployed at the same level of the directory.
Specifically, "transfer the file to the remote deployment server and become a file defined in the remote deployment server by the full name of the file deployment" is executed in a scp command.
Specifically, the method for remotely deploying the product folder by using the recursive function is a devops pipeline type method for deploying the product folder. The local product folder is a local folder after devops pipeline construction is successful.
The application takes the full name of a local product folder and the deployment catalog of a remote deployment server as a first parameter and a second parameter of a recursion function respectively, thereby calling the recursion function to execute the following operations of acquiring the name of the product folder from the first parameter and splicing the name of the product folder behind the second parameter to form the full name of the deployment folder and remotely creating the deployment folder based on the full name, then traversing the files and subfolders under the product folder, splicing the file names of the existing files to the file deployment full name behind the deployment folder and transmitting the files to be files defined by the file deployment full name in the remote deployment server, splicing the names of the existing subfolders behind the first parameter to be used as new first parameter, calling the recursion function continuously to carry out remote deployment on the subfolders. And by analogy, if the folder still exists under the next-level directory, continuing to call the recursive function to process until the deployment of the folder under the lowest-level directory is completed, and at the moment, successfully deploying the folder with the same directory structure as the local product folder under the deployment directory of the remote deployment server. The application provides a brand-new method for deploying folders, which does not need decompression operation, is favorable for avoiding the occurrence of deployment failure and improves the success rate of deployment.
Referring to fig. 1 to 16, an apparatus for remotely deploying an artifact folder using a recursive function according to an embodiment of the present application is disclosed, including:
201. The calling module is used for calling the recursive function by taking the full name of the local product folder as an initial first parameter of the recursive function and taking the deployment catalog of the remote deployment server as an initial second parameter of the recursive function;
202. The acquisition module is used for acquiring names of the product folders from the initial first parameter;
203. The splicing and creating module is used for splicing the names of the product folders behind the initial second parameters to form the full names of the deployment folders, and remotely creating the deployment folders by utilizing the full names on a remote deployment server;
204. The traversal processing module is used for traversing the files and subfolders under the product folder, acquiring the file names corresponding to the files and splicing the file names to the back of the full names of the deployment folders to form the file deployment full names, transmitting the files to the remote deployment server and becoming files defined by the file deployment full names in the remote deployment server, acquiring the names of the subfolders and splicing the names of the subfolders to serve as new first parameters after the initial first parameters if the subfolders exist, taking the full names of the deployment folders as new second parameters, and calling a recursion function.
The application takes the full name of a local product folder and the deployment catalog of a remote deployment server as a first parameter and a second parameter of a recursion function respectively, thereby calling the recursion function to execute the following operations of acquiring the name of the product folder from the first parameter and splicing the name of the product folder behind the second parameter to form the full name of the deployment folder and remotely creating the deployment folder based on the full name, then traversing the files and subfolders under the product folder, splicing the file names of the existing files to the file deployment full name behind the deployment folder and transmitting the files to be files defined by the file deployment full name in the remote deployment server, splicing the names of the existing subfolders behind the first parameter to be used as new first parameter, calling the recursion function continuously to carry out remote deployment on the subfolders. And by analogy, if the folder still exists under the next-level directory, continuing to call the recursive function to process until the deployment of the folder under the lowest-level directory is completed, and at the moment, successfully deploying the folder with the same directory structure as the local product folder under the deployment directory of the remote deployment server. The application provides a brand-new method for deploying folders, which does not need decompression operation, is favorable for avoiding the occurrence of deployment failure and improves the success rate of deployment.
The detailed description of the device for remotely deploying the product folder by using the recursive function is detailed in the above description of the method for remotely deploying the product folder by using the recursive function, and will not be repeated herein.
Referring to fig. 17, the embodiment of the application further discloses an electronic device, which includes:
A processor 31;
A memory 30 in which executable instructions of the processor 31 are stored;
Wherein the processor 31 is configured to perform the above-described method of remotely deploying an artifact folder using a recursive function via execution of the executable instructions.
The present application also provides a computer readable storage medium having a program stored thereon, which when executed by a processor implements the above-described method for remotely deploying an artifact folder using a recursive function.
Embodiments of the present application also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the method of remotely deploying an article folder using a recursive function as described above.
It should be appreciated that in embodiments of the application, the processor may be a central processing module (CentralProcessing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITALSIGNAL PROCESSOR, DSP), application specific integrated circuits (Application SpecificIntegrated Circuit, ASIC), off-the-shelf Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that the processes implementing all or part of the methods of the above embodiments may be implemented by hardware associated with computer program instructions, and the program may be stored in a computer readable storage medium, where the program when executed may include processes of embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-only memory (ROM), a Random access memory (Random AccessMemory, RAM), or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (6)

1.一种利用递归函数远程部署制品文件夹的方法,其特征在于,包括:1. A method for remotely deploying a product folder using a recursive function, characterized by comprising: 将本地的制品文件夹的全名称作为递归函数的初始的第一个参数,将远程部署服务器的部署目录作为所述递归函数的初始的第二个参数,调用所述递归函数;The full name of the local artifact folder is used as the initial first parameter of the recursive function, and the deployment directory of the remote deployment server is used as the initial second parameter of the recursive function, and the recursive function is called; 从所述初始的第一个参数中获取所述制品文件夹的名称;Get the name of the artifact folder from the initial first parameter; 将所述制品文件夹的名称拼接至所述初始的第二个参数后面以形成部署文件夹的全名称,并在所述远程部署服务器上利用该全名称远程创建所述部署文件夹;The name of the artifact folder is concatenated to the end of the initial second parameter to form the full name of the deployment folder, and the deployment folder is remotely created on the remote deployment server using the full name; 遍历所述制品文件夹下的文件和子文件夹,如果存在文件,则获取该文件对应的文件名并拼接至所述部署文件夹的全名称的后面形成文件部署全名称,以及传输该文件至所述远程部署服务器并成为所述远程部署服务器中以所述文件部署全名称定义的文件,如果存在子文件夹,则获取该子文件夹的名称并拼接在所述初始的第一个参数后面作为新的第一个参数,将所述部署文件夹的全名称作为新的第二个参数,调用所述递归函数;Traverse the files and subfolders under the product folder, if there is a file, obtain the file name corresponding to the file and concatenate it to the full name of the deployment folder to form the file deployment full name, and transmit the file to the remote deployment server and become a file defined by the file deployment full name in the remote deployment server, if there is a subfolder, obtain the name of the subfolder and concatenate it to the initial first parameter as a new first parameter, use the full name of the deployment folder as a new second parameter, and call the recursive function; 所述传输该文件至所述远程部署服务器并成为所述远程部署服务器中以所述文件部署全名称定义的文件以scp命令执行;The file is transmitted to the remote deployment server and becomes a file defined by the full name of the file deployment in the remote deployment server and is executed by the scp command; 所述方法为devops流水线部署制品文件夹的方法。The method is a method for deploying a product folder in a devops pipeline. 2.如权利要求1所述的利用递归函数远程部署制品文件夹的方法,其特征在于,还包括:以路径分隔符为标识符,取所述初始的第一个参数中的最后一个所述路径分隔符后面的内容作为所述制品文件夹的名称。2. The method for remotely deploying a product folder using a recursive function as described in claim 1 is characterized in that it also includes: using a path separator as an identifier, and taking the content after the last path separator in the initial first parameter as the name of the product folder. 3.一种利用递归函数远程部署制品文件夹的装置,其特征在于,包括:3. A device for remotely deploying a product folder using a recursive function, characterized by comprising: 调用模块,用于将本地的制品文件夹的全名称作为递归函数的初始的第一个参数,将远程部署服务器的部署目录作为所述递归函数的初始的第二个参数,调用所述递归函数;A calling module, used to take the full name of the local artifact folder as the initial first parameter of the recursive function, take the deployment directory of the remote deployment server as the initial second parameter of the recursive function, and call the recursive function; 获取模块,用于从所述初始的第一个参数中获取所述制品文件夹的名称;An acquisition module, used for acquiring the name of the product folder from the initial first parameter; 拼接及创建模块,用于将所述制品文件夹的名称拼接至所述初始的第二个参数后面以形成部署文件夹的全名称,并在所述远程部署服务器上利用该全名称远程创建所述部署文件夹;A concatenation and creation module, used for concatenating the name of the product folder to the end of the initial second parameter to form the full name of the deployment folder, and remotely creating the deployment folder on the remote deployment server using the full name; 遍历处理模块,用于遍历所述制品文件夹下的文件和子文件夹,如果存在文件,则获取该文件对应的文件名并拼接至所述部署文件夹的全名称的后面形成文件部署全名称,以及传输该文件至所述远程部署服务器并成为所述远程部署服务器中以所述文件部署全名称定义的文件,如果存在子文件夹,则获取该子文件夹的名称并拼接在所述初始的第一个参数后面作为新的第一个参数,将所述部署文件夹的全名称作为新的第二个参数,调用所述递归函数;A traversal processing module, used to traverse the files and subfolders under the product folder, if a file exists, obtain the file name corresponding to the file and concatenate it to the full name of the deployment folder to form a file deployment full name, and transmit the file to the remote deployment server and become a file defined by the file deployment full name in the remote deployment server, if a subfolder exists, obtain the name of the subfolder and concatenate it to the initial first parameter as a new first parameter, use the full name of the deployment folder as a new second parameter, and call the recursive function; 所述传输该文件至所述远程部署服务器并成为所述远程部署服务器中以所述文件部署全名称定义的文件以scp命令执行;The file is transmitted to the remote deployment server and becomes a file defined by the full name of the file deployment in the remote deployment server and is executed by the scp command; 所述装置为devops流水线部署制品文件夹的装置。The device is a device for deploying artifact folders in the devops pipeline. 4.如权利要求3所述的利用递归函数远程部署制品文件夹的装置,其特征在于,还包括:以路径分隔符为标识符,取所述初始的第一个参数中的最后一个所述路径分隔符后面的内容作为所述制品文件夹的名称。4. The device for remotely deploying a product folder using a recursive function as described in claim 3 is characterized in that it also includes: using a path separator as an identifier, and taking the content after the last path separator in the initial first parameter as the name of the product folder. 5.一种电子设备,其特征在于,包括:5. An electronic device, comprising: 处理器;processor; 存储器,其中存储有所述处理器的可执行指令;a memory storing executable instructions of the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1或2所述的利用递归函数远程部署制品文件夹的方法。The processor is configured to execute the method of remotely deploying a product folder using a recursive function as described in claim 1 or 2 by executing the executable instructions. 6.一种计算机可读存储介质,其上存储有程序,其特征在于,所述程序被处理器执行时实现如权利要求1或2所述的利用递归函数远程部署制品文件夹的方法。6. A computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the method for remotely deploying a product folder using a recursive function as described in claim 1 or 2 is implemented.
CN202210254867.4A 2022-03-15 2022-03-15 Method and device for remotely deploying product folders using recursive functions Active CN114741089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210254867.4A CN114741089B (en) 2022-03-15 2022-03-15 Method and device for remotely deploying product folders using recursive functions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210254867.4A CN114741089B (en) 2022-03-15 2022-03-15 Method and device for remotely deploying product folders using recursive functions

Publications (2)

Publication Number Publication Date
CN114741089A CN114741089A (en) 2022-07-12
CN114741089B true CN114741089B (en) 2025-02-18

Family

ID=82277010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210254867.4A Active CN114741089B (en) 2022-03-15 2022-03-15 Method and device for remotely deploying product folders using recursive functions

Country Status (1)

Country Link
CN (1) CN114741089B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113286001A (en) * 2021-05-21 2021-08-20 杭州每刻科技有限公司 Electronic file uploading method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7373348B2 (en) * 2005-04-14 2008-05-13 International Business Machines Corporation Distributed directory deployment
CN108829430A (en) * 2018-06-19 2018-11-16 厦门海迈科技股份有限公司 Java Web project update method and relevant apparatus based on Eclipse and Tomcat
CN109819014B (en) * 2018-12-14 2022-10-25 平安普惠企业管理有限公司 Project deployment method and device, computer equipment and storage medium
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
US11681653B2 (en) * 2020-06-18 2023-06-20 EMC IP Holding Company LLC Namespace representation and enhanced browsability for replicated file systems

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113286001A (en) * 2021-05-21 2021-08-20 杭州每刻科技有限公司 Electronic file uploading method and system

Also Published As

Publication number Publication date
CN114741089A (en) 2022-07-12

Similar Documents

Publication Publication Date Title
CN110741350A (en) Backup and Restore Architecture for Distributed Computing Systems
US6912543B2 (en) Object-oriented method and system for transferring a file system
CN106878428A (en) Method and device for file upload
CN114328029B (en) A backup method, device, electronic device and storage medium for application resources
WO2017045345A1 (en) Resource management method and apparatus, and multi-mode soft base station unified network management
CN111104387A (en) Method and apparatus for obtaining data set on server
CN114741089B (en) Method and device for remotely deploying product folders using recursive functions
CN109614442B (en) Data table maintenance method and device for data synchronization, storage medium and electronic equipment
WO2022037207A1 (en) Wafer repair method and apparatus, and device and storage medium
CN112883006B (en) Enterprise-level container mirror image acceleration method and device, electronic equipment and storage medium
CN112685102B (en) Gateway plug-in hot loading method, device, equipment and medium
CN112579325A (en) Business object processing method and device, electronic equipment and storage medium
CN112199529A (en) Picture processing method and device, electronic equipment and storage medium
CN112130817A (en) A method, system, device and readable storage medium for implementing a multi-version interface
CN110442421A (en) A kind of generic service conversion method and system based on Kubernetes
CN109842644B (en) Parameter expansion method and system, cloud computing management platform assembly and user terminal
CN114564480B (en) Data processing method, device, electronic device and storage medium based on Flink platform
CN110727565A (en) A method and system for collecting network equipment platform information
CN115834604A (en) Data sending end, receiving end, synchronization method and computer program product
CN114116675A (en) A data archiving method and device
CN114676101A (en) A file processing method, apparatus, device and storage medium
CN111858487A (en) Data update method and device
CN110109883B (en) File filtering and storing method and device
CN115080564B (en) A method and device for synchronizing a Merkle directed acyclic graph
CN117708073B (en) File synchronization request processing method and device, electronic equipment and readable medium

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