An application publishing method, apparatus, device, and storage medium
By using client instances and array file management of object storage services, the complex operation and maintenance issues in traditional web application deployment are solved, enabling efficient file deployment and application release.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 创优数字科技(广东)有限公司
- Filing Date
- 2024-12-30
- Publication Date
- 2026-04-28
AI Technical Summary
In traditional web application development, deploying build files on a server requires multiple steps, including server configuration, network setup, and backups. This leads to complex maintenance tasks, is prone to errors, and can affect the normal release of the application.
By creating a client instance for the object storage service, cleaning and configuring files, using an array file store to store deployment files, determining the upload path, and uploading the files to the object storage service, the application deployment is completed.
It avoids the operational complexity caused by server deployment, improves storage space utilization and upload efficiency, and ensures the integrity of deployment files and the smooth release of applications.
Smart Images

Figure CN119759371B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of application publishing technology, specifically to an application publishing method, apparatus, device, and storage medium. Background Technology
[0002] As web applications continue to develop, front-end development processes are also constantly evolving. The traditional web application development process includes steps such as writing code, local debugging, building, and deployment to the server. The building process is the process of converting the front-end code into a browser executable file. After the build is completed, the generated folder contains all the built files, such as JavaScript files, CSS files, and HTML files. Usually, these built files are deployed on the server so that they can be accessed by users.
[0003] However, deploying the built files on a server requires the server itself to configure network, backups, and other aspects, making maintenance complex, prone to errors, and affecting the normal release of the application. Summary of the Invention
[0004] In view of this, this application provides an application deployment method, apparatus, device, and storage medium to solve the problem that deploying built files on a server requires the server to configure network, backup, and other functions, which makes operation and maintenance complex, prone to errors, and affects the normal deployment of applications.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] Firstly, an application deployment method includes:
[0007] Identify the various deployment files for the target application;
[0008] Create a client instance corresponding to the object storage service, and configure the client instance to invoke the object storage service;
[0009] Use the configured client instance to perform file cleanup on the object storage service;
[0010] Each of the deployment files is stored in a pre-created array to obtain an array file;
[0011] Determine the upload path;
[0012] The array file is uploaded to the cleaned object storage service according to the upload path to complete the release of the target application.
[0013] Preferably, the step of using the configured client instance to perform file cleanup on the object storage service includes:
[0014] Determine the environment variables corresponding to the configured client instance;
[0015] Determine the directory names of all file directories in the object storage service;
[0016] Determine if a directory exists whose directory name contains the environment variable mentioned;
[0017] If so, then mark the file directories whose directory names contain the environment variables;
[0018] Clean up the marked file directories.
[0019] Preferably, the cleaning of the marked file directory includes:
[0020] Delete all files in the marked directory;
[0021] Determine whether the marked file directory contains subdirectories;
[0022] If so, delete all files in the subdirectory and delete the subdirectory itself;
[0023] Delete the marked file directory;
[0024] Return to the step of determining whether a file directory whose directory name contains the environment variable exists, until no file directory whose directory name contains the environment variable exists in the object storage service.
[0025] Preferably, determining the upload path includes:
[0026] Determine the output directory of the array file and obtain the absolute path of the output directory;
[0027] Configure path variables based on the absolute path;
[0028] Extract the network address of the storage bucket from the configured client instance;
[0029] The filename of the array file is determined based on the path variable;
[0030] The upload path is obtained by concatenating the network address with the filename.
[0031] Preferably, the determination of the deployment files for the target application includes:
[0032] Registering predefined upload plugins into the resource packaging process of the target application;
[0033] Real-time monitoring of the lifecycle hooks corresponding to the target application;
[0034] If the end hook in the lifecycle hook is triggered, then the files built by the static module packaging tool during the resource packaging process are obtained as the deployment files.
[0035] Preferably, configuring the client instance includes:
[0036] Determine the access key ID and access key ciphertext of the object storage service;
[0037] Based on the access key ID and access key ciphertext, the target region is determined in the object storage service.
[0038] Obtain the bucket name of the storage bucket in the target area;
[0039] Configure the client instance using the access key ID, access key ciphertext, target region, and bucket name.
[0040] Preferably, it further includes:
[0041] Obtain the output configuration information of the array file;
[0042] Determine the configuration address in the output configuration information;
[0043] Extract the network address of the storage bucket from the configured client instance;
[0044] Replace the configuration address in the output configuration information with the network address of the storage bucket to obtain the updated output configuration information;
[0045] In response to a user's request to access resources of the target application, the updated configuration information is sent to the user's client so that the user can access the array file based on the updated configuration information.
[0046] Secondly, an application publishing device includes:
[0047] The deployment file determination module is used to determine the various deployment files of the target application;
[0048] The calling module is used to create a client instance corresponding to the object storage service and configure the client instance to call the object storage service;
[0049] The file cleanup module is used to perform file cleanup on the object storage service using the configured client instance.
[0050] The array file acquisition module is used to store each of the deployment files in a pre-established array to obtain an array file;
[0051] The upload path determination module is used to determine the upload path;
[0052] The array file upload module is used to upload the array file to the cleaned object storage service according to the upload path, so as to complete the release of the target application.
[0053] Thirdly, an application distribution device, including a memory and a processor;
[0054] The memory is used to store programs;
[0055] The processor is configured to execute the program to implement the steps of the application deployment method as described in any of the first aspects.
[0056] Fourthly, a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the application publishing method as described in any of the first aspects.
[0057] As can be seen from the above technical solution, this application determines the various deployment files of the target application; creates a client instance corresponding to the object storage service and configures the client instance to call the object storage service; uses the configured client instance to clean up the files of the object storage service; stores each deployment file in a pre-established array to obtain an array file; determines the upload path; and uploads the array file to the cleaned object storage service according to the upload path to complete the deployment of the target application. This application first determines the various deployment files of the target application and calls the object storage service to achieve file upload and deployment. This requires creating and configuring a client instance corresponding to the object storage service to achieve the call, which avoids the complex operation and maintenance problems caused by deployment on a server. Then, file cleanup saves resources and improves storage space utilization. Since the number of deployment files is variable, storing each deployment file in an array before uploading to the object storage service ensures the integrity of the deployment files and improves upload efficiency. Before uploading, the upload path also needs to be determined to ensure the correctness of the upload destination, enabling the target application to be successfully deployed. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0059] Figure 1 An optional flowchart of an application publishing method provided in an embodiment of this application;
[0060] Figure 2 This is a schematic diagram of the structure of an application publishing device provided in an embodiment of this application;
[0061] Figure 3 This is a schematic diagram of the structure of an application publishing device provided in an embodiment of this application. Detailed Implementation
[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] As web applications continue to develop, front-end development processes are also constantly evolving. The traditional web application development process includes steps such as writing code, local debugging, building, and deployment to the server. The building process is the process of converting the front-end code into a browser executable file. After the build is completed, the generated folder contains all the built files, such as JavaScript files, CSS files, and HTML files. Usually, these built files are deployed on the server so that they can be accessed by users.
[0064] However, deploying the built files on a server requires the server itself to configure network, backups, and other aspects, making maintenance complex, prone to errors, and affecting the normal release of the application.
[0065] In addition, server performance is limited. When the application to be deployed is large or the traffic is high, the server is very likely to be unable to meet the deployment requirements, resulting in slow access speed or even service unavailability after the application is deployed. The deployment files after the build is usually large in size and will be stored on the server for a long time, occupying a lot of disk space.
[0066] To address the problems of the prior art, embodiments of the present invention provide an application deployment method. This invention can be used in numerous general-purpose or dedicated computing device environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.
[0067] This method can also be applied to various computer terminals or smart terminals. The executing entity can be the processor or server of the computer terminal or smart terminal. The method flowchart is shown below. Figure 1 As shown, it specifically includes:
[0068] S1: Identify the various deployment files for the target application.
[0069] The target application in this application refers to the application that you want to publish, that is, the application that you want to deploy, such as a newly created web application.
[0070] Applications intended for release will have multiple deployment files built in advance. Deployment files refer to a collection of files generated by converting, combining, and optimizing source code, resource files, etc. from the development phase through a series of build tools and processes. These files are used for deployment in production or testing environments and are the key parts that enable the target application to run normally in the corresponding environment.
[0071] Deployment files include various types, such as JavaScript files, CSS files, HTML files, pose resource files, etc. Deploying these deployment files is a key step in application release, so this application first needs to identify each deployment file.
[0072] S2: Create a client instance corresponding to the object storage service, and configure the client instance to call the object storage service.
[0073] Object storage service refers to OSS (Object Storage Service), a cloud storage service used to store and manage large amounts of unstructured data, such as images, videos, documents, and other types of files. Users can store various data in the form of objects in this repository and access and manage them over the network, thereby enabling application deployment and publishing.
[0074] This application abandons the existing method of using servers for application deployment, and instead calls object storage services to upload deployment files to the object storage service, thereby providing a highly available, highly reliable, and highly functional storage service. This can improve the access speed after application deployment, reduce operation and maintenance configuration, and improve the clarity of the development process.
[0075] To invoke the object storage service, you first need to create a client instance corresponding to the object storage service. This is equivalent to establishing a channel or bridge with the object storage service, which allows you to upload deployment files. Then, you need to configure the created client instance to specify the destination and purpose of the channel.
[0076] S3: Use the configured client instance to perform file cleanup on the object storage service.
[0077] To avoid resource waste and improve storage space utilization, file / resource cleanup is performed before actually using the object storage service to release internal space. Specifically, previously uploaded deployment files are deleted from the object storage service. This process can be implemented through predefined plugins.
[0078] Define a custom WebpackCleanOssPlugin class and a corresponding Webpack plugin. It can accept an options object as a parameter to the constructor, which can provide possibilities for future expansion.
[0079] Since the configured client instance has a clear destination and purpose, it is clear which part of the object storage service is to be cleaned. Therefore, in this step, the configured client instance is used to locate the location that needs to be cleaned, and then the files are cleaned up using the Webpack plugin.
[0080] S4: Store each of the deployment files in a pre-established array to obtain an array file.
[0081] Since the deployment files are of different types and have different contents, directly uploading and deploying the deployment files would result in low efficiency and low upload success rate. Therefore, this application pre-creates an array, such as the files array, to store the various deployment files, and then uploads the array files.
[0082] This allows for better control over the deployment order of each deployment file. By fixing the deployment order in an array, the upload process can proceed in an orderly manner, avoiding application failures caused by incorrect upload order of deployment files.
[0083] In addition, storing deployment files in an array facilitates centralized management and version tracking, and ensures the consistency of the status of each deployment file, thus guaranteeing the successful release of the target application.
[0084] S5: Determine the upload path.
[0085] Defining a specific upload path can better ensure file security. Different security policies can be set for different upload paths, such as firewall rules and encryption levels. It also makes it easier for object storage services to locate and use files.
[0086] S6: Upload the array file to the cleaned object storage service according to the upload path to complete the release of the target application.
[0087] During this process, a verification operation can be performed, such as checking whether the array file is complete and free of abnormalities, and whether the object storage service has been cleaned up. Setting up such a verification operation in advance can ensure the smooth upload of the array file.
[0088] After uploading, you can also check whether the array file has been uploaded completely and whether it has been uploaded to the set location / folder.
[0089] As can be seen from the above technical solution, this application determines the various deployment files of the target application; creates a client instance corresponding to the object storage service and configures the client instance to call the object storage service; uses the configured client instance to clean up the files of the object storage service; stores each deployment file in a pre-established array to obtain an array file; determines the upload path; and uploads the array file to the cleaned object storage service according to the upload path to complete the deployment of the target application. This application first determines the various deployment files of the target application and calls the object storage service to achieve file upload and deployment. This requires creating and configuring a client instance corresponding to the object storage service to achieve the call, which avoids the complex operation and maintenance problems caused by deployment on a server. Then, file cleanup saves resources and improves storage space utilization. Since the number of deployment files is variable, storing each deployment file in an array before uploading to the object storage service ensures the integrity of the deployment files and improves upload efficiency. Before uploading, the upload path also needs to be determined to ensure the correctness of the upload destination, enabling the target application to be successfully deployed.
[0090] The process of determining the various deployment files of the target application in this application includes the following steps:
[0091] Registering predefined upload plugins into the resource packaging process of the target application;
[0092] Real-time monitoring of the lifecycle hooks corresponding to the target application;
[0093] If the end hook in the lifecycle hook is triggered, then the files built by the static module packaging tool during the resource packaging process are obtained as the deployment files.
[0094] Specifically, the `apply` method can be used to register a predefined upload plugin into the target application's resource bundling process, which is the Webpack compilation flow. It can listen to the `beforeRun` hook, meaning that the upload plugin's logic will be executed before each Webpack compilation. Additionally, it's necessary to monitor the lifecycle hooks corresponding to the target application in real time. The most important of these is the `done` hook. When the `done` hook is triggered, it indicates that the deployment files have been built, meaning the various files built by the static module bundler during the resource bundling process are retrieved. These files are the deployment files; Webpack is the static module bundler.
[0095] Additionally, this application defines a class called WebpackUploadOssPlugin, which is also a Webpack plugin used to upload files after the deployment files have been fully built. This plugin can be triggered via lifecycle hooks.
[0096] The process of configuring the client instance in the method provided in this embodiment of the invention is described in detail below:
[0097] Determine the access key ID and access key ciphertext of the object storage service;
[0098] Based on the access key ID and access key ciphertext, the target region is determined in the object storage service.
[0099] Obtain the bucket name of the storage bucket in the target area;
[0100] Configure the client instance using the access key ID, access key ciphertext, target region, and bucket name.
[0101] Specifically, to invoke the object storage service, you need to specify its access key ID (accessKeyId) and access key secret (accessKeySecret). The access key ID and access key secret can be used to log in to the object storage service. At the same time, they also implicitly define the area that can be accessed in the object storage service, i.e., the target area. In an example, the object storage service contains folder A and folder B. The access key ID and access key secret correspond to folder B. Then folder B is the target area. Folder B can also be regarded as bucket B. The bucket name of bucket B can also be determined. After the client instance is created, it can be configured using the access key ID, access key secret, target area, and bucket name to establish a bridge to the object storage service. It can then perform CRUD operations on files in the object storage service.
[0102] Furthermore, in this application, after the client instance is configured, the process of using the configured client instance to perform file cleanup on the object storage service is described in detail below:
[0103] Determine the environment variables corresponding to the configured client instance;
[0104] Determine the directory names of all file directories in the object storage service;
[0105] Determine if a directory exists whose directory name contains the environment variable mentioned;
[0106] If so, then mark the file directories whose directory names contain the environment variables;
[0107] Clean up the marked file directories.
[0108] Specifically, the environment variable is defined as ENVIRONMENT, which can be used to specify the build environment. This environment variable corresponds to the location where file cleanup is needed. Therefore, when performing file cleanup, the environment variable is first used for location, that is, to determine the directory names of all file directories in the object storage service. The file directories whose names contain this environment variable are the directories that need to be located. Specifically, these directory names have a prefix such as "build / ${ENVIRONMENT} / ", meaning that the file directories containing this environment variable are the directories that need to be cleaned. Since the object storage service may contain a large number of files and directories, the located file directories can be marked first to facilitate cleanup.
[0109] The process of cleaning up the marked file directories may include the following steps:
[0110] Delete all files in the marked directory;
[0111] Determine whether the marked file directory contains subdirectories;
[0112] If so, delete all files in the subdirectory and delete the subdirectory itself;
[0113] Delete the marked file directory;
[0114] Return to the step of determining whether a file directory whose directory name contains the environment variable exists, until no file directory whose directory name contains the environment variable exists in the object storage service.
[0115] Understandably, the above process is a recursive deletion method. Using a recursive deletion method can make the deletion more thorough. The marked file directory can be considered as a main directory, which itself corresponds to some files. At the same time, it also contains some subdirectories, which also correspond to some files. Therefore, in a recursive manner, first all files in the marked main directory are deleted, then it is determined whether it contains subdirectories. If so, all files in the subdirectories are deleted, and finally all file directories (including the main directory and subdirectories) are deleted, ensuring the thoroughness of the cleanup.
[0116] In addition, to further ensure complete cleanup, the process can be repeated to determine if there are any directories whose names contain the environment variable, until no directories containing the environment variable exist in the object storage service.
[0117] Alternatively, the deleteFile method can be used, which also deletes all files under a specified prefix. It builds an array of objects containing file keys by iterating through result.objects and then uses the client.deleteMulti method to delete these files in batches.
[0118] The process of determining the upload path in this application will be explained in detail below.
[0119] Determine the output directory of the array file and obtain the absolute path of the output directory;
[0120] Configure path variables based on the absolute path;
[0121] Extract the network address of the storage bucket from the configured client instance;
[0122] The filename of the array file is determined based on the path variable;
[0123] The upload path is obtained by concatenating the network address with the filename.
[0124] Specifically, the absolute path of the output directory of the array file can be obtained using the path.resolve method and stored in the outputPath variable. The outputPath variable is the path variable configured based on the absolute path. Then, the file name of the array file is determined based on the path variable. The upload path consists of two parts: the address and the file name. Therefore, it is also necessary to extract the network address (url) of the storage bucket from the configured client instance and concatenate the network address of the storage bucket and the file name as the upload path.
[0125] Furthermore, this application may also include the following steps:
[0126] Obtain the output configuration information of the array file;
[0127] Determine the configuration address in the output configuration information;
[0128] Extract the network address of the storage bucket from the configured client instance;
[0129] Replace the configuration address in the output configuration information with the network address of the storage bucket to obtain the updated output configuration information;
[0130] In response to a user's request to access resources of the target application, the updated configuration information is sent to the user's client so that the user can access the array file based on the updated configuration information.
[0131] Specifically, the above process is the process by which users access and call resources after the application is published. The output configuration information is the output configuration, which contains the specific configuration address. By replacing the network address of the storage bucket with this configuration address, users can access resources, such as referencing deployment files in an array file through an HTML file.
[0132] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide an application publishing device for […]. Figure 1 In the specific implementation of the method, the application publishing device provided in this embodiment of the invention can be used on a computer terminal or various mobile devices, in conjunction with... Figure 2 The application publishing device will be introduced, such as... Figure 2 As shown, the device may include:
[0133] The deployment file determination module 10 is used to determine the various deployment files of the target application;
[0134] Module 20 is used to create a client instance corresponding to the object storage service and configure the client instance to call the object storage service.
[0135] File cleanup module 30 is used to clean up files in the object storage service using the configured client instance;
[0136] The array file acquisition module 40 is used to store each of the deployment files in a pre-established array to obtain an array file;
[0137] Upload path determination module 50 is used to determine the upload path;
[0138] The array file upload module 60 is used to upload the array file to the cleaned object storage service according to the upload path, so as to complete the release of the target application.
[0139] As can be seen from the above technical solution, this application determines the various deployment files of the target application; creates a client instance corresponding to the object storage service and configures the client instance to call the object storage service; uses the configured client instance to clean up the files of the object storage service; stores each deployment file in a pre-established array to obtain an array file; determines the upload path; and uploads the array file to the cleaned object storage service according to the upload path to complete the deployment of the target application. This application first determines the various deployment files of the target application and calls the object storage service to achieve file upload and deployment. This requires creating and configuring a client instance corresponding to the object storage service to achieve the call, which avoids the complex operation and maintenance problems caused by deployment on a server. Then, file cleanup saves resources and improves storage space utilization. Since the number of deployment files is variable, storing each deployment file in an array before uploading to the object storage service ensures the integrity of the deployment files and improves upload efficiency. Before uploading, the upload path also needs to be determined to ensure the correctness of the upload destination, enabling the target application to be successfully deployed.
[0140] Furthermore, embodiments of this application provide an application publishing device. Optionally, Figure 3 The hardware structure block diagram of the application distribution device is shown, with reference to... Figure 3 The hardware structure of the application publishing device may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.
[0141] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.
[0142] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0143] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.
[0144] The memory stores a program, which the processor can call to execute. The program is used to perform the following application deployment methods, including:
[0145] Identify the various deployment files for the target application;
[0146] Create a client instance corresponding to the object storage service, and configure the client instance to invoke the object storage service;
[0147] Use the configured client instance to perform file cleanup on the object storage service;
[0148] Each of the deployment files is stored in a pre-created array to obtain an array file;
[0149] Determine the upload path;
[0150] The array file is uploaded to the cleaned object storage service according to the upload path to complete the release of the target application.
[0151] Optionally, the refined and extended functions of the program can be found in the description of the application publishing method in the method embodiments.
[0152] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor. When the program runs, it controls the device where the storage medium is located to execute the following application publishing method, including:
[0153] Identify the various deployment files for the target application;
[0154] Create a client instance corresponding to the object storage service, and configure the client instance to invoke the object storage service;
[0155] Use the configured client instance to perform file cleanup on the object storage service;
[0156] Each of the deployment files is stored in a pre-created array to obtain an array file;
[0157] Determine the upload path;
[0158] The array file is uploaded to the cleaned object storage service according to the upload path to complete the release of the target application.
[0159] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.
[0160] Optionally, the refined and extended functions of the program can be found in the description of the application publishing method in the method embodiments.
[0161] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.
[0162] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0163] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0164] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An application deployment method, characterized in that, include: Identify the various deployment files for the target application; Create a client instance corresponding to the object storage service, and configure the client instance to invoke the object storage service; The configured client instance is used to perform file cleanup on the object storage service; including: determining the environment variables corresponding to the configured client instance; determining the directory names of all file directories in the object storage service; determining whether there are file directories whose directory names contain the environment variables; if so, marking the file directories whose directory names contain the environment variables; and cleaning up the marked file directories. Each of the deployment files is stored in a pre-created array to obtain an array file; Determining the upload path includes: determining the output directory of the array files and obtaining the absolute path of the output directory; configuring path variables according to the absolute path; extracting the network address of the storage bucket from the configured client instance; determining the filename of the array files according to the path variables; and concatenating the network address with the filename to obtain the upload path. The array file is uploaded to the cleaned object storage service according to the upload path to complete the release of the target application.
2. The method according to claim 1, characterized in that, The cleaning of the marked file directory includes: Delete all files in the marked directory; Determine whether the marked file directory contains subdirectories; If so, delete all files in the subdirectory and delete the subdirectory itself; Delete the marked file directory; Return to the step of determining whether a file directory whose directory name contains the environment variable exists, until no file directory whose directory name contains the environment variable exists in the object storage service.
3. The method according to claim 1, characterized in that, The deployment files for determining the target application include: Registering predefined upload plugins into the resource packaging process of the target application; Real-time monitoring of the lifecycle hooks corresponding to the target application; If the end hook in the lifecycle hook is triggered, then the files built by the static module packaging tool during the resource packaging process are obtained as the deployment files.
4. The method according to claim 1, characterized in that, The configuration of the client instance includes: Determine the access key ID and access key ciphertext of the object storage service; Based on the access key ID and access key ciphertext, the target region is determined in the object storage service. Obtain the bucket name of the storage bucket in the target area; Configure the client instance using the access key ID, access key ciphertext, target region, and bucket name.
5. The method according to any one of claims 1 to 4, characterized in that, Also includes: Obtain the output configuration information of the array file; Determine the configuration address in the output configuration information; Extract the network address of the storage bucket from the configured client instance; Replace the configuration address in the output configuration information with the network address of the storage bucket to obtain the updated output configuration information; In response to a user's request to access resources of the target application, the updated configuration information is sent to the user's client so that the user can access the array file based on the updated configuration information.
6. An application publishing device, characterized in that, include: The deployment file determination module is used to determine the various deployment files of the target application; The calling module is used to create a client instance corresponding to the object storage service and configure the client instance to call the object storage service; The file cleanup module is used to clean up files in the object storage service using a configured client instance; it includes: determining the environment variables corresponding to the configured client instance; determining the directory names of all file directories in the object storage service; determining whether there are file directories whose directory names contain the environment variables; if so, marking the file directories whose directory names contain the environment variables; and cleaning up the marked file directories. The array file acquisition module is used to store each of the deployment files in a pre-established array to obtain an array file; An upload path determination module is used to determine the upload path; including: determining the output directory of the array file and obtaining the absolute path of the output directory; configuring path variables according to the absolute path; extracting the network address of the storage bucket from the configured client instance; determining the filename of the array file according to the path variables; and concatenating the network address and the filename to obtain the upload path; The array file upload module is used to upload the array file to the cleaned object storage service according to the upload path, so as to complete the release of the target application.
7. An application publishing device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the application publishing method as described in any one of claims 1-5.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the application publishing method as described in any one of claims 1-5.
Citation Information
Patent Citations
Construction method of enterprise knowledge management system and storage medium
CN118503515A