Jenkins-based application automatic packaging and publishing method and device, equipment and medium
By adopting the Jenkins-based automated packaging and publishing method in financial application software development, the problem of inefficiency of traditional manual packaging and publishing is solved, and the application automation packaging and publishing is realized, improving efficiency and accuracy.
Patent Information
- Application Number
- CN202411515309.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-21
AI Technical Summary
The traditional manual packaging and publishing method is inefficient, prone to human errors, and consumes time and energy, resulting in low efficiency in packaging and publishing of applications.
Using Jenkins-based application automation packaging and publishing method, the Jenkins server obtains application code from the code repository when the application publishing task is triggered, querys and executes preset packaging and testing tasks, generates application packages and publishes them.
It realizes automatic packaging and release of applications, reduces manual operations, and improves the efficiency and accuracy of packaging and release of applications.
Smart Images

Figure CN119493594A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of application development and financial technology, and in particular to a method, device, equipment and medium for automated application packaging and publishing based on Jenkins. Background Art
[0002] With the development of computer technology, more and more financial application software is applied to the financial field. Financial application software is used as a platform for product transactions between financial enterprises and customers, which makes it easier for financial enterprises to market financial products to users and for users to purchase financial products. In the process of software development, the packaging and release of applications is a critical and tedious task. The traditional manual packaging and release method requires merging codes, configuring packaging certificates, locally verifying whether the configuration items are complete and correct, building packaging, exporting ipa packages, uploading distribution platforms, integration testing, UI testing, performance testing, security testing, reinforcement, uploading to AppStore and other processes. Manual operation is required, which is prone to human errors, and consumes time and energy, resulting in the inefficiency of application packaging and release. Therefore, how to improve the efficiency of application packaging and release has become an urgent problem to be solved. Summary of the invention
[0003] The present application provides a Jenkins-based application automated packaging and publishing method, device, equipment and medium to improve the efficiency of application packaging and publishing.
[0004] In a first aspect, the present application provides a method for automated application packaging and publishing based on Jenkins, the method comprising:
[0005] When the application release task is triggered, the application code is obtained from the preset code repository based on the Jenkins server;
[0006] Based on the application code, querying a preset packaging task library and a preset test task library for a target packaging task and a target test task corresponding to the application code;
[0007] Based on the Jenkins server, the packaging task and the testing task are executed to obtain an application package corresponding to the application to be released, so as to release the application to be released based on the application package.
[0008] In a second aspect, the present application also provides an application automation packaging and publishing device based on Jenkins, the device comprising:
[0009] The code acquisition module is used to obtain application code from the preset code repository based on the Jenkins server when the application release task is triggered;
[0010] A task query module, used to query a preset packaging task library and a target test task corresponding to the application code based on the application code;
[0011] The task execution module is used to execute the packaging task and the testing task based on the Jenkins server, obtain the application package corresponding to the application to be released, and release the application to be released based on the application package.
[0012] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned Jenkins-based application automation packaging and publishing method when executing the computer program.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above-mentioned Jenkins-based application automated packaging and publishing method.
[0014] The present application discloses a method, device, equipment and medium for automatic packaging and publishing of applications based on Jenkins. When an application publishing task is triggered, the application code is obtained from a preset code repository based on a Jenkins server; based on the application code, a target packaging task and a target test task corresponding to the application code are queried in a preset packaging task library and a test task library; based on the Jenkins server, the packaging task and the test task are executed to obtain an application package corresponding to the application to be published, so as to publish the application to be published based on the application package. The present application can store pre-configured packaging tasks and test tasks through a packaging task library and a test task library. When an application publishing task is triggered, the application code is obtained through a Jenkins server and the packaging tasks and test tasks corresponding to the application code are automatically matched and executed, thereby realizing automatic packaging and publishing of applications without manual operation and improving the efficiency of application packaging and publishing. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1This is a schematic flow chart of a first embodiment of a Jenkins-based application automated packaging and publishing method provided in an embodiment of the present application;
[0017] Figure 2 This is a schematic flow chart of a second embodiment of a Jenkins-based application automated packaging and publishing method provided in an embodiment of the present application;
[0018] Figure 3 This is a schematic flow chart of a third embodiment of a Jenkins-based application automated packaging and publishing method provided in an embodiment of the present application;
[0019] Figure 4 A schematic block diagram of an application automatic packaging and publishing device based on Jenkins provided in an embodiment of the present application;
[0020] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0023] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0024] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0025] The embodiments of the present application provide a method, device, equipment and medium for automatic packaging and publishing of applications based on Jenkins. The method for automatic packaging and publishing of applications based on Jenkins can be applied to a server, and pre-configured packaging tasks and test tasks are stored in a packaging task library and a test task library. When an application publishing task is triggered, the application code is obtained through the Jenkins server, and the packaging tasks and test tasks corresponding to the application code are automatically matched and executed, so that automatic packaging and publishing of applications are realized without manual operation, and the efficiency of application packaging and publishing is improved. The server can be an independent server or a server cluster.
[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] See also Figure 1 , Figure 1 This is a schematic flow chart of an automatic application packaging and publishing method based on Jenkins provided by an embodiment of the present application. The automatic application packaging and publishing method based on Jenkins can be applied to a server, and is used to store pre-configured packaging tasks and test tasks through a packaging task library and a test task library. When an application publishing task is triggered, the application code is obtained through the Jenkins server, and the packaging tasks and test tasks corresponding to the application code are automatically matched and executed, thereby realizing automatic application packaging and publishing without manual operation, and improving the efficiency of application packaging and publishing.
[0028] like Figure 1 As shown, the Jenkins-based application automatic packaging and publishing method specifically includes steps S101 to S103.
[0029] S101. When the application release task is triggered, the application code is obtained from the preset code repository based on the Jenkins server;
[0030] In one embodiment, the Jenkins server is configured with a version control system (such as Git, a distributed version control system for efficiently and quickly handling small to large project version management) and code repository access credentials (such as username and password, or more secure SSH keys), and can automatically pull the latest code from the code repository when an application release task is triggered. Among them, Jenkins is an automation server, mainly used to automate various continuous integration and continuous delivery tasks.
[0031] In one embodiment, the application code is the code submitted by the developer after completing an application development, application function upgrade or application repair, and is the code corresponding to the application to be released. The application code is submitted to the version control system and stored in the code repository. When the application release task is triggered, it is obtained from the code repository through the Jenkins server.
[0032] Furthermore, when the application release task is triggered, based on the Jenkins server, before obtaining the application code from a preset code repository, it also includes: building a code trigger based on the code repository and the Jenkins server; detecting whether there is a code submission event based on the code trigger, obtaining a detection result, and determining whether to trigger the application release task based on the detection result.
[0033] In one embodiment, Jenkins is configured with an automatic notification mechanism for one or more specific code repositories. When new code is submitted to the code repository, the automatic notification mechanism triggers the code trigger in Jenkins, notifying Jenkins to check the changes in the code repository.
[0034] In one embodiment, after receiving the notification, Jenkins will detect whether there is a code submission event based on the code trigger. Specifically, Jenkins will check the latest submission record in the code repository to determine whether there is a new code change, thereby obtaining the detection result.
[0035] In one embodiment, according to the detection result, it can be determined whether to trigger the application release task. Specifically, if the detection result shows that there is a new code submission, the application release task will be triggered.
[0036] S102: Based on the application code, query a preset packaging task library and a preset test task library for a target packaging task and a target test task corresponding to the application code;
[0037] Furthermore, based on the application code, the target packaging task and the target testing task corresponding to the application code are queried in the preset packaging task library and the testing task library, including: identifying the application code to obtain identification information of the application to be released; based on the identification information, searching for the target packaging task and the target testing task in the packaging task library and the testing task library.
[0038] In one embodiment, the code analysis tool or algorithm corresponding to the Jenkins server can be used to extract key features or identification elements in the application code, thereby obtaining identification information of the application to be released. The identification information may include key attributes such as the name, version number, module, function category, and application category of the application.
[0039] In one embodiment, the obtained identification information is used to search in the pre-established packaging task library and test task library. Specifically, by matching the identification information of the application to be released with the identification information of each application in the task library, the packaging task and test task with the highest matching degree are found as the target packaging task and target test task that are suitable for the current application to be released.
[0040] In one embodiment, the packaging task library includes packaging tasks for application codes of different types and characteristics. The test task library stores test tasks corresponding to each application.
[0041] S103: Based on the Jenkins server, execute the packaging task and the testing task to obtain an application package corresponding to the application to be released, so as to release the application to be released based on the application package.
[0042] In one embodiment, after the target packaging task is queried, the target packaging task and the target testing task are automatically executed through the Jenkins server to compile and package the application code according to the target packaging task to obtain one or more distribution format files, and the target testing task is automatically executed through the Jenkins server to test the obtained distribution format files to ensure the quality of the application.
[0043] In one embodiment, the distribution format file that has passed the test is used as an application package, and is uploaded to an application store or an internal publishing platform through a Jenkins server for users to download.
[0044] Furthermore, based on the Jenkins server, the packaging task and the testing task are executed to obtain the application package corresponding to the application to be released, so as to release the application to be released based on the application package, and also includes: after obtaining the application package, performing security reinforcement processing on the application package, obtaining the file to be released, and uploading the file to be released to a preset platform to release the application to be released.
[0045] In one embodiment, hardening is an important step to improve application security, which may include: 1. Code obfuscation, obfuscating the application code to make the decompiled code difficult to read and understand. 2. String encryption, encrypting the string resources in the application to prevent sensitive information from being obtained through string analysis. 3. Dynamic code loading, using dynamic code loading technology to reduce the possibility of static analysis. 4. Anti-tampering detection, adding an anti-tampering detection mechanism to the application, the application can refuse to run or report when tampering is detected. 5. Use of security libraries, using security libraries to replace unsafe functions and APIs to reduce security vulnerabilities. 6. Integrity verification, adding an integrity verification mechanism, such as verification or digital signature, to ensure that the application file has not been tampered with during transmission and installation.
[0046] In one embodiment, after the reinforcement process is completed, the files to be released are uploaded to a preset platform to release the application. Common platforms include App Store, internal distribution servers of enterprises, or third-party application stores. Specifically, an automated upload tool is configured in the Jenkins server. After the reinforcement process is completed, the automated upload tool is controlled to upload the reinforced files to be released to the preset platform.
[0047] In one embodiment, after the file is uploaded, verify whether the file is successfully uploaded to ensure that the file is downloadable on the platform. And complete the application release process according to the platform requirements. For example, if uploaded to the App Store, submit for review and wait for the review result; if uploaded to the internal distribution server, ensure that the server configuration is correct, and notify relevant personnel to download and install; if uploaded to a third-party application store, follow the release process and requirements of the third-party application store.
[0048] The above embodiment provides a method, device, equipment and medium for automatic packaging and publishing of applications based on Jenkins. When an application publishing task is triggered, the application code is obtained from a preset code repository based on the Jenkins server; based on the application code, the target packaging task and the target test task corresponding to the application code are queried in the preset packaging task library and the test task library; based on the Jenkins server, the packaging task and the test task are executed to obtain the application package corresponding to the application to be published, so as to publish the application to be published based on the application package. The present application can store pre-configured packaging tasks and test tasks through the packaging task library and the test task library. When the application publishing task is triggered, the application code is obtained through the Jenkins server and the packaging tasks and test tasks corresponding to the application code are automatically matched and executed, thereby realizing automatic packaging and publishing of applications without manual operation, and improving the efficiency of application packaging and publishing.
[0049] See also Figure 2 , Figure 2 This is a schematic flow chart of an automatic packaging and publishing method for applications based on Jenkins provided by an embodiment of the present application. The automatic packaging and publishing method for applications based on Jenkins can be applied to a server, and is used to pre-store the packaging tasks and test tasks of each application in a packaging task library and a test task library, so that Jenkins can automatically manage and execute the test tasks of each application, ensuring that each code submission can automatically execute the corresponding packaging and testing, thereby improving the efficiency of application packaging and publishing.
[0050] like Figure 2 As shown, before step S102, the Jenkins-based application automatic packaging and publishing method further includes steps S201 to S203.
[0051] S201, obtaining a description file, a code signature, a certificate, and packaging environment parameters corresponding to at least one application;
[0052] S202: constructing a packaging task corresponding to each of the application programs based on the description file, the code signature, the certificate, and the packaging environment parameters;
[0053] S203: Store the identification information of each application and the packaging task to generate the packaging task library.
[0054] In one embodiment, the configuration information of the application is obtained, including description files, code signatures, certificates, packaging environment parameters, etc. The description file contains information such as application ID, developer certificate, device ID, etc., which is used to install the application on a specific device and can be obtained from a developer account or a continuous integration server. Code signatures are used to verify the source and integrity of the application. Certificates usually include development certificates and release certificates, which can be obtained from a developer account. Packaging environment parameters include build configuration, target device, compiler options, etc. They are usually stored in the project's configuration file.
[0055] In one embodiment, a packaging task corresponding to each application is constructed based on the description file, code signature, certificate, and packaging environment parameters obtained. Specifically, a packaging task is created through Jenkins, and the description file, code signature, certificate, and environment parameters used by the packaging task are configured for the packaging task to obtain the packaging task corresponding to each application.
[0056] In one embodiment, the identification information of each application is associated with the corresponding packaging task, and the information is stored to generate a packaging task library. Specifically, the identification information may include the name, version number, build number, submission hash value, etc. of the application. The identification information is associated with the build steps and configuration parameters to ensure that each application's identification corresponds to a unique packaging task.
[0057] In one embodiment, the packaging task library is a library that centrally stores all application packaging tasks. The packaging task library can be stored using a database, a file system, or a cloud storage.
[0058] In one embodiment, the packaging task library is updated regularly to include new applications and updates. The packaging task library is maintained to ensure that all information is up to date.
[0059] Furthermore, before step S102, it also includes: obtaining a test framework and test parameters corresponding to at least one application; generating a test task corresponding to each of the applications based on the test framework and the test parameters; storing the identification information of each of the applications together with the test task to generate the test task library.
[0060] In one embodiment, the test configuration information of the application is obtained, including the test framework and test parameters. Specifically, the test configuration file corresponding to the application is obtained from the version control system (such as Git) through Jenkins. The test configuration file is parsed to obtain the specific information of the test framework and parameters.
[0061] In one embodiment, the choice of testing framework depends on the type of application (eg, iOS, Android, Web, etc.) and the development language.
[0062] In one embodiment, test parameters (such as test environment (simulator or real machine), test cases, test suites, performance test parameters, etc.) can be set by the developer and configured in the test configuration file of the project.
[0063] In one embodiment, a test task is created through Jenkins, a test framework and parameters used by the test task are configured for the test task, and a test task corresponding to each application is obtained.
[0064] In one embodiment, the identification information may include the name, version number, build number, submission hash value, etc. of the application program. The identification information is associated with the test steps and configuration parameters to ensure that each application program identification corresponds to a unique test task.
[0065] In one embodiment, the test task library is a library that centrally stores all application test tasks, and the test task library can be stored using a database, a file system, or a cloud storage.
[0066] In the above embodiment, the packaging tasks and test tasks of each application can be pre-stored in the packaging task library and the test task library. Jenkins can automatically manage and execute the test tasks of each application, ensuring that each code submission can automatically execute the corresponding packaging and testing, thereby improving the efficiency of application packaging and release.
[0067] See also Figure 3 , Figure 3 This is a schematic flow chart of an automatic application packaging and publishing method based on Jenkins provided in an embodiment of the present application. The automatic application packaging and publishing method based on Jenkins can be applied to a server to automatically perform packaging, testing and publishing tasks through Jenkins, automatically complete the entire process of application packaging and publishing, and improve application publishing efficiency.
[0068] like Figure 3 As shown, the Jenkins-based application automatic packaging and publishing method specifically includes steps S301 to S303.
[0069] S301, based on the Jenkins server, executing the target packaging task, compiling and packaging the application code, and obtaining the distribution format file corresponding to the application to be released;
[0070] S302: Based on the Jenkins server, execute the target test task to test the distribution format file;
[0071] S303: Use the distribution format file that has passed the test as the application package, and publish the application to be published based on the application package.
[0072] In one embodiment, after the target packaging task is queried, the target packaging task is automatically executed by the Jenkins server to compile and package the application code according to the target packaging task. The compilation process converts the source code into an executable file or a library file, and finally generates one or more distribution format files.
[0073] In one embodiment, after packaging is completed and one or more distribution format files are generated, the target test task is automatically executed through the Jenkins server. The purpose of the test is to ensure that the application functions as expected and no new errors or problems are introduced, including unit testing, integration testing, UI testing, performance testing, security testing, etc. The test results are collected, including test logs, test reports, code coverage and other information.
[0074] In one embodiment, the distribution format file that has passed the test is used as an application package, and is uploaded to an application store or an internal publishing platform through a Jenkins server for users to download.
[0075] In the above embodiment, Jenkins can be used to automatically execute packaging, testing and publishing tasks, automatically completing the entire process of application packaging and publishing, thereby improving application publishing efficiency.
[0076] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of an application automation packaging and publishing device based on Jenkins, which is used to execute the aforementioned application automation packaging and publishing method based on Jenkins. The application automation packaging and publishing device based on Jenkins can be configured on a server.
[0077] like Figure 4 As shown, the Jenkins-based application automatic packaging and publishing device 400 includes:
[0078] The code acquisition module 401 is used to acquire the application code from a preset code repository based on the Jenkins server when the application release task is triggered;
[0079] A task query module 402 is used to query a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code;
[0080] The task execution module 403 is used to execute the packaging task and the testing task based on the Jenkins server, obtain the application package corresponding to the application to be released, and release the application to be released based on the application package.
[0081] Furthermore, the Jenkins-based application automatic packaging and publishing device 400 further includes a task triggering judgment module, which includes:
[0082] A code trigger building unit, used to build a code trigger based on the code repository and the Jenkins server;
[0083] The detection result obtaining unit is used to detect whether there is a code submission event based on the code trigger, obtain the detection result, and determine whether to trigger the application release task based on the detection result.
[0084] Furthermore, the task query module 402 includes:
[0085] An identification information obtaining unit, used to identify the application code and obtain identification information of the application to be released;
[0086] The task searching unit is used to search the target packaging task and the target testing task in the packaging task library and the testing task library based on the identification information.
[0087] Furthermore, the Jenkins-based application automated packaging and publishing device 400 further includes a packaging task library generation module, and the packaging task library generation module includes:
[0088] An information acquisition unit, used to acquire a description file, a code signature, a certificate, and packaging environment parameters corresponding to at least one application;
[0089] A packaging task construction unit, used to construct a packaging task corresponding to each of the applications based on the description file, the code signature, the certificate and the packaging environment parameters;
[0090] The packaging task library generation unit is used to store the identification information of each application and the packaging task to generate the packaging task library.
[0091] Furthermore, the Jenkins-based application automated packaging and publishing device 400 further includes a test task library generation module, and the test task library generation module includes:
[0092] An information acquisition unit, used to acquire a test framework and test parameters corresponding to at least one application program;
[0093] A test task generating unit, used for generating a test task corresponding to each of the application programs based on the test framework and the test parameters;
[0094] The test task library generating unit is used to store the identification information of each application program and the test task to generate the test task library.
[0095] Furthermore, the task execution module 403 includes:
[0096] A distribution format file obtaining unit is used to execute the target packaging task based on the Jenkins server, compile and package the application code, and obtain the distribution format file corresponding to the application to be released;
[0097] A distribution format file testing unit, used to execute the target test task based on the Jenkins server and test the distribution format file;
[0098] The application package publishing unit is used to use the distribution format file that has passed the test as the application package, so as to publish the application to be published based on the application package.
[0099] Furthermore, the task execution module 403 further includes:
[0100] The reinforcement processing unit is used to perform security reinforcement processing on the application package after obtaining the application package, obtain the file to be released, and upload the file to be released to a preset platform to release the application to be released.
[0101] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0102] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0103] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0104] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0105] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any Jenkins-based application automatic packaging and publishing method.
[0106] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0107] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any Jenkins-based application automation packaging and publishing method.
[0108] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0109] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0110] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0111] When the application release task is triggered, the application code is obtained from the preset code repository based on the Jenkins server;
[0112] Based on the application code, querying a preset packaging task library and a preset test task library for a target packaging task and a target test task corresponding to the application code;
[0113] Based on the Jenkins server, the packaging task and the testing task are executed to obtain an application package corresponding to the application to be released, so as to release the application to be released based on the application package.
[0114] In one embodiment, the processor is further used to implement the following before obtaining the application code from a preset code repository based on the Jenkins server when the application release task is triggered:
[0115] Building a code trigger based on the code repository and the Jenkins server;
[0116] Based on the code trigger, it is detected whether there is a code submission event, and a detection result is obtained, so as to determine whether to trigger the application publishing task based on the detection result.
[0117] In one embodiment, when the processor searches for a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code, the processor is used to implement:
[0118] Identify the application code to obtain identification information of the application to be released;
[0119] Based on the identification information, the target packaging task and the target testing task are searched in the packaging task library and the testing task library.
[0120] In one embodiment, before the processor searches for a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code, the processor is further configured to implement:
[0121] Obtain description files, code signatures, certificates, and packaging environment parameters corresponding to at least one application;
[0122] Based on the description file, the code signature, the certificate and the packaging environment parameters, construct a packaging task corresponding to each of the applications;
[0123] The identification information of each of the applications is stored together with the packaging task to generate the packaging task library.
[0124] In one embodiment, before the processor searches for a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code, the processor is further configured to implement:
[0125] Obtain a test framework and test parameters corresponding to at least one application;
[0126] Based on the test framework and the test parameters, generate test tasks corresponding to each of the application programs;
[0127] The identification information of each application program and the test task are stored to generate the test task library.
[0128] In one embodiment, when the processor executes the packaging task and the testing task based on the Jenkins server to obtain the application package corresponding to the application to be released, and releases the application to be released based on the application package, it is used to implement:
[0129] Based on the Jenkins server, the target packaging task is executed to compile and package the application code to obtain a distribution format file corresponding to the application to be released;
[0130] Based on the Jenkins server, executing the target test task, testing the distribution format file;
[0131] The distribution format file that passes the test is used as the application package, so as to publish the application to be published based on the application package.
[0132] In one embodiment, the processor is implemented based on the Jenkins server, executes the packaging task and the testing task, obtains the application package corresponding to the application to be released, and releases the application to be released based on the application package, and is also used to implement:
[0133] After obtaining the application package, security reinforcement processing is performed on the application package to obtain the file to be released, and the file to be released is uploaded to a preset platform to release the application to be released.
[0134] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the Jenkins-based application automation packaging and publishing methods provided in the embodiments of the present application.
[0135] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A Jenkins-based application automated packaging and publishing method, characterized in that: include: When the application release task is triggered, the application code is obtained from the preset code repository based on the Jenkins server; Based on the application code, querying a preset packaging task library and a preset test task library for a target packaging task and a target test task corresponding to the application code; Based on the Jenkins server, the packaging task and the testing task are executed to obtain an application package corresponding to the application to be released, so as to release the application to be released based on the application package.
2. The Jenkins-based application automation packaging and publishing method according to claim 1 is characterized in that: When the application release task is triggered, before obtaining the application code from the preset code repository based on the Jenkins server, the following steps are also included: Building a code trigger based on the code repository and the Jenkins server; Based on the code trigger, it is detected whether there is a code submission event, and a detection result is obtained, so as to determine whether to trigger the application publishing task based on the detection result.
3. The Jenkins-based application automation packaging and publishing method according to claim 1 is characterized in that: The step of searching, based on the application code, a preset packaging task library and a preset testing task library for a target packaging task and a target testing task corresponding to the application code comprises: Identify the application code to obtain identification information of the application to be released; Based on the identification information, the target packaging task and the target testing task are searched in the packaging task library and the testing task library.
4. The Jenkins-based application automation packaging and publishing method according to claim 1 is characterized in that: Before searching for a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code, the method further includes: Obtain description files, code signatures, certificates, and packaging environment parameters corresponding to at least one application; Based on the description file, the code signature, the certificate and the packaging environment parameters, construct a packaging task corresponding to each of the applications; The identification information of each of the applications is stored together with the packaging task to generate the packaging task library.
5. The Jenkins-based application automation packaging and publishing method according to claim 4 is characterized in that: Before searching for a target packaging task and a target testing task corresponding to the application code in a preset packaging task library and a testing task library based on the application code, the method further includes: Obtain a test framework and test parameters corresponding to at least one application; Based on the test framework and the test parameters, generate test tasks corresponding to each of the application programs; The identification information of each application program and the test task are stored to generate the test task library.
6. The Jenkins-based application automation packaging and publishing method according to claim 1 is characterized in that: The step of executing the packaging task and the testing task based on the Jenkins server to obtain an application package corresponding to the application to be released, and releasing the application to be released based on the application package, includes: Based on the Jenkins server, the target packaging task is executed to compile and package the application code to obtain a distribution format file corresponding to the application to be released; Based on the Jenkins server, executing the target test task, testing the distribution format file; The distribution format file that passes the test is used as the application package, so as to publish the application to be published based on the application package.
7. The Jenkins-based application automated packaging and publishing method according to any one of claims 1 to 6, characterized in that: The method of executing the packaging task and the testing task based on the Jenkins server to obtain an application package corresponding to the application to be released, and releasing the application to be released based on the application package, further includes: After obtaining the application package, security reinforcement processing is performed on the application package to obtain the file to be released, and the file to be released is uploaded to a preset platform to release the application to be released.
8. An automatic application packaging and publishing device based on Jenkins, characterized in that: include: The code acquisition module is used to obtain application code from the preset code repository based on the Jenkins server when the application release task is triggered; A task query module, used to query a preset packaging task library and a target test task corresponding to the application code based on the application code; The task execution module is used to execute the packaging task and the testing task based on the Jenkins server, obtain the application package corresponding to the application to be released, and release the application to be released based on the application package.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the Jenkins-based application automatic packaging and publishing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the Jenkins-based automatic application packaging and publishing method according to any one of claims 1 to 7.